Refactoring

This commit is contained in:
Anuken
2020-05-13 22:29:27 -04:00
parent 6e62936458
commit a06f6f0b2d
22 changed files with 76 additions and 91 deletions
+22
View File
@@ -1,6 +1,7 @@
package mindustry.game;
import arc.*;
import arc.scene.ui.layout.*;
import arc.util.ArcAnnotate.*;
import mindustry.type.*;
import mindustry.world.*;
@@ -93,4 +94,25 @@ public class Objectives{
public abstract static class ZoneObjective implements Objective{
public @NonNull SectorPreset zone;
}
/** Defines a specific objective for a game. */
public static interface Objective{
/** @return whether this objective is met. */
boolean complete();
/** @return the string displayed when this objective is completed, in imperative form.
* e.g. when the objective is 'complete 10 waves', this would display "complete 10 waves".
* If this objective should not be displayed, should return null.*/
@Nullable String display();
/** Build a display for this zone requirement.*/
default void build(Table table){
}
default SectorPreset zone(){
return this instanceof ZoneObjective ? ((ZoneObjective)this).zone : null;
}
}
}