using GameObject class as an order target

Destructable made a member of GameObject
cruise missiles can be shot down
This commit is contained in:
devZoGok
2025-12-04 15:03:35 +02:00
parent fbe1be2b93
commit 1d0bf8d349
26 changed files with 219 additions and 181 deletions
+1 -15
View File
@@ -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();
}
}
}
}