use uvec unstead of two params, simplifies things

This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:01 +00:00
parent 5e950528c1
commit 0700a13129
2 changed files with 6 additions and 5 deletions

View file

@ -73,7 +73,7 @@ int CTTRTSGame::AddUnit( std::shared_ptr<CUnit> unit )
// Verify if the unit can be placed on the current board
const uvector2 pos = unit->getPos();
if( (pos.x < cols) && (pos.y < rows) )
if( (pos.x < dimentions.x) && (pos.y < dimentions.y) )
return 1;
m_allUnits.push_back(unit);

View file

@ -14,8 +14,7 @@ class CTTRTSGame
public:
CTTRTSGame( ucoord_t c, ucoord_t r )
: cols (c)
, rows (r)
: dimentions( {c,r} )
{
}
@ -50,6 +49,9 @@ public:
// Get orders by index as above
inline const COrder& GetOrdersByIndex( unsigned int i ) const { return m_orders[i]; }
// Get dimentions
inline const uvector2& GetDimentions() const { return dimentions; };
private:
@ -72,8 +74,7 @@ private:
COrderVector m_orders;
// Dimensions of the game
ucoord_t rows;
ucoord_t cols;
uvector2 dimentions;
};
#endif //_GAME_H_