Finialise the full game step
Had to rework a ton of code from bad design. NOTE: FRIENDLY FIRE IS ON >:D
This commit is contained in:
parent
6fc41914f7
commit
aee703b107
7 changed files with 379 additions and 57 deletions
|
@ -68,13 +68,34 @@ const char* tests()
|
|||
if( game.SimulateToNextTurn() )
|
||||
return "Failed to simulate a blank game";
|
||||
|
||||
if( game.GetNumOrders() )
|
||||
return "Game started with non-zero order number";
|
||||
|
||||
if( game.GetNumUnits() )
|
||||
return "Game started with non-zero unit number";
|
||||
if( game.GetNumUnits() )
|
||||
return "Game started with non-zero unit number";
|
||||
}
|
||||
|
||||
{
|
||||
CTTRTSGame game( 5, 5 );
|
||||
|
||||
CUnit unit = CUnit::getUnitFromVis('>');
|
||||
const unit_id_t id = unit.getID();
|
||||
COrder order;
|
||||
|
||||
unit.setPos( {2,2} );
|
||||
unit.setPlayer(0);
|
||||
|
||||
game.AddUnit(std::move(unit));
|
||||
|
||||
order.unit = id;
|
||||
order.order = order_c::F;
|
||||
|
||||
game.IssueOrder(0,order);
|
||||
|
||||
game.SimulateToNextTurn();
|
||||
|
||||
if( game.GetUnitByIDConst(id).getPos() != uvector2{3,2} )
|
||||
return "Simple movement order failed";
|
||||
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue