diff options
author | Joursoir <chat@joursoir.net> | 2021-02-17 19:02:29 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-02-17 19:02:29 +0000 |
commit | 00fe0c43e7080a8d8af2566196a8540eee553ad2 (patch) | |
tree | 3e9c6af4a3af6cd68e89add8af09ef5fc832de0a /GameField.hpp | |
parent | 87d7320f84926c4d10734c773ecf3cf4eb47ddc4 (diff) | |
download | lp-gomoku-00fe0c43e7080a8d8af2566196a8540eee553ad2.tar.gz lp-gomoku-00fe0c43e7080a8d8af2566196a8540eee553ad2.tar.bz2 lp-gomoku-00fe0c43e7080a8d8af2566196a8540eee553ad2.zip |
add command line user interface (clui); improve GameField class
Diffstat (limited to 'GameField.hpp')
-rw-r--r-- | GameField.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/GameField.hpp b/GameField.hpp index 1d2af31..d312644 100644 --- a/GameField.hpp +++ b/GameField.hpp @@ -11,21 +11,21 @@ enum states { class GameField { // optional: - int field[3][3]; - int free; + int **field; + int cols, rows; + int free_fields; int win_length; // non-optional: int state; int who_move; public: - GameField() : field{0}, free(9), win_length(3), state(G_NONE), - who_move(G_XPLAYER) { } - ~GameField() { } + GameField(int a_cols, int a_rows, int a_lwin); + ~GameField(); int GetState() { return state; } - bool CanMove(int x, int y); - void Move(int x, int y); + bool CanMove(int y, int x); + void Move(int y, int x); private: void UpdateState(); |