diff --git a/core/src/mindustry/core/GameState.java b/core/src/mindustry/core/GameState.java index b4b753db0c..ce9154c39e 100644 --- a/core/src/mindustry/core/GameState.java +++ b/core/src/mindustry/core/GameState.java @@ -38,7 +38,7 @@ public class GameState{ /** Note that being in a campaign does not necessarily mean having a sector. */ public boolean isCampaign(){ - return rules.sector != null || rules.satellite != null; + return rules.sector != null || rules.region != null; } public boolean hasSector(){ diff --git a/core/src/mindustry/game/GlobalData.java b/core/src/mindustry/game/GlobalData.java index 0e72ef7245..7900f912f0 100644 --- a/core/src/mindustry/game/GlobalData.java +++ b/core/src/mindustry/game/GlobalData.java @@ -3,6 +3,7 @@ package mindustry.game; import arc.*; import arc.struct.*; import arc.files.*; +import arc.util.ArcAnnotate.*; import arc.util.io.*; import mindustry.*; import mindustry.content.*; @@ -19,6 +20,8 @@ import static mindustry.Vars.*; public class GlobalData{ private ObjectMap> unlocked = new ObjectMap<>(); private ObjectIntMap items = new ObjectIntMap<>(); + private Array satellites = new Array<>(); + private ObjectMap regions = new ObjectMap<>(); private boolean modified; public GlobalData(){ @@ -35,6 +38,10 @@ public class GlobalData{ }); } + public @Nullable MapRegion getRegion(String name){ + return regions.get(name); + } + public void exportData(Fi file) throws IOException{ Array files = new Array<>(); files.add(Core.settings.getSettingsFile()); diff --git a/core/src/mindustry/game/MapRegion.java b/core/src/mindustry/game/MapRegion.java new file mode 100644 index 0000000000..8a6908b216 --- /dev/null +++ b/core/src/mindustry/game/MapRegion.java @@ -0,0 +1,12 @@ +package mindustry.game; + +/** Defines a special map that can be visited, loaded, and saved. */ +public abstract class MapRegion{ + + /** Name of the region. Used for lookup and save names. */ + public abstract String name(); + + public void load(){ + + } +} diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index d657d5bfde..e93c4a55d3 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -59,8 +59,8 @@ public class Rules{ public float launchWaveMultiplier = 2f; /** Sector for saves that have them.*/ public @Nullable Sector sector; - /** Satellite that save is on. Indicates campaign. */ - public @Nullable Satellite satellite; + /** Region that save is on. Indicates campaign. */ + public @Nullable MapRegion region; /** Spawn layout. */ public Array spawns = new Array<>(); /** Determines if there should be limited respawns. */