Files
Mindustry/core/src/mindustry/service/SStat.java
2022-10-09 17:47:12 -04:00

56 lines
1010 B
Java

package mindustry.service;
import static mindustry.Vars.*;
public enum SStat{
unitsDestroyed,
attacksWon,
pvpsWon,
timesLaunched,
blocksDestroyed,
itemsLaunched,
reactorsOverheated,
maxUnitActive,
unitTypesBuilt,
unitsBuilt,
bossesDefeated,
maxPlayersServer,
mapsMade,
mapsPublished,
maxWavesSurvived,
blocksBuilt,
maxProduction,
sectorsControlled,
schematicsCreated,
bouldersDeconstructed, //TODO
totalCampaignItems, //TODO
;
public int get(){
return service.getStat(name(), 0);
}
public void max(int amount){
if(amount > get()){
set(amount);
}
}
public void set(int amount){
service.setStat(name(), amount);
service.storeStats();
for(Achievement a : Achievement.all){
a.checkCompletion();
}
}
public void add(int amount){
set(get() + amount);
}
public void add(){
add(1);
}
}