mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
refactored command execution
This commit is contained in:
+3
-7
@@ -54,14 +54,10 @@ namespace battleship{
|
||||
return;
|
||||
}
|
||||
|
||||
void AddUnitCommand::addUnit(){
|
||||
void AddUnitCommand::execute(){
|
||||
AbstractCommand::execute();
|
||||
|
||||
Player* player = Game::getSingleton()->getPlayer(playerId);
|
||||
player->addUnit(GameObjectFactory::createUnit(player, unitId, pos, rot, 100));
|
||||
}
|
||||
|
||||
void AddUnitCommand::execute(){
|
||||
AbstractCommand::handle();
|
||||
validate();
|
||||
addUnit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user