More stat tracking

This commit is contained in:
Anuken
2026-03-07 20:58:04 -05:00
parent b85056a493
commit 45e5ca3612
3 changed files with 7 additions and 5 deletions

View File

@@ -192,12 +192,12 @@ public class Logic implements ApplicationListener{
});
Events.on(UnitDestroyEvent.class, e -> {
if(e.unit.team() != state.rules.defaultTeam){
if(e.unit.team != state.rules.defaultTeam){
state.stats.enemyUnitsDestroyed ++;
}
if(checkCampaignStats()){
state.getPlanet().stats().enemyUnitsDestroyed.increment(e.unit.type);
}
if(checkCampaignStats()){
(e.unit.team != state.rules.defaultTeam ? state.getPlanet().stats().enemyUnitsDestroyed : state.getPlanet().stats().unitsDestroyed).increment(e.unit.type);
}
});

View File

@@ -12,6 +12,8 @@ public class CampaignStats{
public ObjectIntMap<Block> enemyBuildingsDestroyed = new ObjectIntMap<>();
/** Player team units produced by type. */
public ObjectIntMap<UnitType> unitsProduced = new ObjectIntMap<>();
/** Player team units destroyed by type. */
public ObjectIntMap<UnitType> unitsDestroyed = new ObjectIntMap<>();
/** Record of blocks that have been placed by count. */
public ObjectIntMap<Block> buildingsBuilt = new ObjectIntMap<>();
/** Record of blocks that have been placed by count. */