use uvec unstead of two params, simplifies things
This commit is contained in:
parent
5e950528c1
commit
0700a13129
2 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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_
|
Loading…
Add table
Add a link
Reference in a new issue