New WIP custom map selection

This commit is contained in:
Anuken
2019-05-12 10:32:08 -04:00
parent e5d19a9819
commit 4ae2370137
9 changed files with 225 additions and 153 deletions

View File

@@ -5,6 +5,8 @@ import io.anuke.arc.collection.StringMap;
import io.anuke.arc.files.FileHandle;
import io.anuke.arc.graphics.Texture;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.game.Rules;
import io.anuke.mindustry.io.JsonIO;
public class Map implements Comparable<Map>{
/** Whether this is a custom map. */
@@ -53,6 +55,22 @@ public class Map implements Comparable<Map>{
Vars.data.modified();
}
public Rules rules(){
return JsonIO.read(Rules.class, tags.get("rules", "{}"));
}
/** Whether this map has a core of the enemy 'wave' team. Default: true.
* Used for checking Attack mode validity.*/
public boolean hasEnemyCore(){
return tags.get("enemycore", "true").equals("true");
}
/** Whether this map has a core of any team except the default player team. Default: true.
* Used for checking PvP mode validity.*/
public boolean hasOtherCores(){
return tags.get("othercore", "true").equals("true");
}
public String author(){
return tag("author");
}