mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
using GameObject class as an order target
Destructable made a member of GameObject cruise missiles can be shot down
This commit is contained in:
+1
-15
@@ -1,5 +1,6 @@
|
||||
#include "gameObject.h"
|
||||
#include "gameManager.h"
|
||||
#include "destructable.h"
|
||||
#include "defConfigs.h"
|
||||
#include "player.h"
|
||||
#include "game.h"
|
||||
@@ -222,19 +223,4 @@ namespace battleship{
|
||||
return "resources";
|
||||
}
|
||||
}
|
||||
|
||||
void GameObject::updateGameStats(Unit *targetUnit){
|
||||
if(targetUnit->getHealth() <= targetUnit->getDeathHp()){
|
||||
Player *targUnitPlayer = targetUnit->getPlayer();
|
||||
|
||||
if(targetUnit->isVehicle()){
|
||||
player->incVehiclesDestroyed();
|
||||
targUnitPlayer->incVehiclesLost();
|
||||
}
|
||||
else{
|
||||
player->incStructuresDestroyed();
|
||||
targUnitPlayer->incStructuresLost();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user