New WIP custom map selection
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user