-
Notifications
You must be signed in to change notification settings - Fork 0
/
FBullCowGame.h
53 lines (41 loc) · 876 Bytes
/
FBullCowGame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
This acts as a Model in the MVC pattern
This class is reponsible for the game logic definition for implementation see the .cpp file
*/
#pragma once
#include <string>
using FString = std::string;
using int32 = int;
struct FBullCowCount
{
int32 Bulls = 0;
int32 Cows = 0;
};
enum EWordStatus
{
Invalid_Status,
OK,
Not_Isogram,
Wrong_Length,
Not_Lowercase
};
class FBullCowGame
{
public:
FBullCowGame(); //constructor
int32 GetMaxTries() const;
int32 GetCurrentTry() const;
int32 GetHiddenWordLength() const;
bool IsGameWon() const;
EWordStatus CheckGuessValidity(FString) const;
void Reset(int32);
FBullCowCount SubmitValidGuess(FString);
private:
//see constructor to initialization
int32 MyCurrentTry;
FString MyHiddenWord;
bool bIsWonGame;
bool IsIsogram(FString) const;
bool IsLowercase(FString) const;
void DefineHiddenWord(int32);
};