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:
Marc Di Luzio 2014-12-16 13:13:01 +00:00
parent 6fc41914f7
commit aee703b107
7 changed files with 379 additions and 57 deletions

View file

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