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:
@@ -21,14 +21,10 @@ namespace battleship{
|
||||
resourceAmmount = atoi(arguments[2].c_str());
|
||||
}
|
||||
|
||||
void AddResourceCommand::addResource(){
|
||||
void AddResourceCommand::execute(){
|
||||
AbstractCommand::execute();
|
||||
|
||||
Player *player = Game::getSingleton()->getPlayer(playerId);
|
||||
player->updateResource(ResourceType(resourceId), resourceAmmount, true);
|
||||
}
|
||||
|
||||
void AddResourceCommand::execute(){
|
||||
AbstractCommand::handle();
|
||||
validate();
|
||||
addResource();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user