From 6cd30c76fa96418ae4378fce82597a0de2123bf0 Mon Sep 17 00:00:00 2001 From: r0nk Date: Sat, 15 Aug 2020 15:57:14 -0500 Subject: [PATCH] game_state struct moved to its own header. --- include/game_state.hpp | 11 +++++++++++ src/main.cpp | 8 +------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 include/game_state.hpp diff --git a/include/game_state.hpp b/include/game_state.hpp new file mode 100644 index 0000000..3f6fe15 --- /dev/null +++ b/include/game_state.hpp @@ -0,0 +1,11 @@ +#ifndef OUR_DICK_GAME_STATE_HPP +#define OUR_DICK_GAME_STATE_HPP + +#define TILE_COUNT 9 + +struct game_state { + int turn; + char board[TILE_COUNT]; +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp index 5eedc9d..c127171 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include #include "render.hpp" +#include "game_state.hpp" // 0 | 1 | 2 // --------- @@ -10,13 +11,6 @@ // --------- // 6 | 7 | 8 -#define TILE_COUNT 9 - -struct game_state { - int turn; - char board[TILE_COUNT]; -}; - int get_player_input(){ //TODO get player input return rand()%9;