Partial 7.0 merge - API preview

This commit is contained in:
Anuken
2021-06-02 11:08:08 -04:00
parent ea75a357ca
commit 28b235ef07
531 changed files with 12356 additions and 6286 deletions

View File

@@ -0,0 +1,53 @@
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,
;
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);
}
}