Add new game string outputer and use it.

modify some of the other outputters to look better
This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:02 +00:00
parent 24ac058475
commit 002c1e5927
5 changed files with 39 additions and 2 deletions

View file

@ -36,6 +36,7 @@ public:
CTTRTSGame( ucoord_t c, ucoord_t r )
: dimensions( c,r )
, turn (0)
{
}
@ -79,6 +80,9 @@ public:
// Note: this function will return invalid a draw was reached
// best practice would be to call with GetNumUnits() == 0
Team CheckForWin() const;
// Get the game information as a string
std::string GetStateAsString() const;
private:
@ -102,6 +106,11 @@ private:
// Dimensions of the game
uvector2 dimensions;
// Int to store the current turn
unsigned int turn;
};
#define GAME_HEADER_FORMATTER "===== GAME TURN =====\nSIZE:[%u,%u]\nTURN:%u"
#endif //_GAME_H_