Board should be using unit vis values not unit type values

This commit is contained in:
Marc Di Luzio 2014-12-16 13:12:55 +00:00
parent c5ef2a5ee2
commit 5ca0fc3e23
2 changed files with 13 additions and 13 deletions

View file

@ -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;
}