diff --git a/game/board.cpp b/game/board.cpp index 3b257fa..39a4aa5 100644 --- a/game/board.cpp +++ b/game/board.cpp @@ -13,7 +13,7 @@ CBoard::CBoard( unsigned int c, unsigned int r ) // constructor -CBoard::CBoard( unsigned int c, unsigned int r, vunitType_c&& b ) +CBoard::CBoard( unsigned int c, unsigned int r, vunitVis_c&& b ) : cols ( c ) , rows ( r ) , total ( rows * cols ) @@ -23,7 +23,7 @@ CBoard::CBoard( unsigned int c, unsigned int r, vunitType_c&& b ) } // print get a slot on the board -unitType_c CBoard::get( const unsigned int c, const unsigned int r ) const +unitVis_c CBoard::get( const unsigned int c, const unsigned int r ) const { if ( (r >= rows) || (c >= cols) ) return square_invalid; @@ -32,12 +32,12 @@ unitType_c CBoard::get( const unsigned int c, const unsigned int r ) const } // Get a square on the board -unitType_c CBoard::set( const unsigned int c, const unsigned int r , const unitType_c n ) +unitVis_c CBoard::set( const unsigned int c, const unsigned int r , const unitVis_c n ) { if ( (r >= rows) || (c >= cols) ) return square_invalid; - unitType_c old = board[r*c]; + unitVis_c old = board[r*c]; board[r*c] = n; return old; } \ No newline at end of file diff --git a/game/board.h b/game/board.h index 05232cb..ce7236d 100644 --- a/game/board.h +++ b/game/board.h @@ -7,11 +7,11 @@ #include // std::numeric_limits #include // std::vector -typedef std::vector< unitType_c > vunitType_c; +typedef std::vector< unitVis_c > vunitVis_c; // Invalid value for the board square -constexpr unitType_c square_invalid = std::numeric_limits::max(); -constexpr unitType_c square_empty = ' '; +constexpr unitVis_c square_invalid = std::numeric_limits::max(); +constexpr unitVis_c square_empty = ' '; // Class to store simple data about a board class CBoard @@ -26,7 +26,7 @@ public: CBoard( unsigned int c, unsigned int r ); // constructor - CBoard( unsigned int c, unsigned int r, vunitType_c&& b ); + CBoard( unsigned int c, unsigned int r, vunitVis_c&& b ); // Default destructor ~CBoard() = default; @@ -35,20 +35,20 @@ public: inline void clear() { fill(square_empty); } // fill the board - inline void fill(unitType_c v) { std::fill(board.begin(),board.end(),v); }; + inline void fill(unitVis_c v) { std::fill(board.begin(),board.end(),v); }; // Get a square on the board - unitType_c get( const unsigned int c, const unsigned int r ) const; + unitVis_c get( const unsigned int c, const unsigned int r ) const; // Get the full board - inline const vunitType_c& get() const { return board; }; + inline const vunitVis_c& get() const { return board; }; // Get a square on the board - unitType_c set( const unsigned int c, const unsigned int r , const unitType_c n ); + unitVis_c set( const unsigned int c, const unsigned int r , const unitVis_c n ); private: - vunitType_c board; // Board data storage + vunitVis_c board; // Board data storage }; #endif //_BOARD_H_ \ No newline at end of file