Major restructuring of Vars class- made global state less messy
This commit is contained in:
@@ -2,17 +2,8 @@ package io.anuke.mindustry;
|
||||
|
||||
import com.badlogic.gdx.Application.ApplicationType;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.Weapon;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.Recipe;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
|
||||
/**ick, global state*/
|
||||
@@ -23,52 +14,23 @@ public class Vars{
|
||||
public static final float respawnduration = 60*4;
|
||||
public static final float wavespace = 20*60*(android ? 2 : 1);
|
||||
public static final float enemyspawnspace = 65;
|
||||
public static boolean debug = false;
|
||||
public static float fontscale = Unit.dp.inPixels(1f)/2f;
|
||||
public static final float fontscale = Unit.dp.inPixels(1f)/2f;
|
||||
public static final int baseCameraScale = Math.round(Unit.dp.inPixels(4));
|
||||
public static final int zoomScale = Math.round(Unit.dp.inPixels(1));
|
||||
|
||||
public static int multiplier = android ? 2 : 1;
|
||||
public static final Vector2 vector = new Vector2();
|
||||
//not marked as final, because of warnings
|
||||
public static boolean debug = false;
|
||||
|
||||
public static final int multiplier = android ? 2 : 1;
|
||||
|
||||
public static final int tilesize = 8;
|
||||
|
||||
public static Control control;
|
||||
public static UI ui;
|
||||
|
||||
public static final ObjectMap<Item, Integer> items = new ObjectMap<>();
|
||||
public static final ObjectMap<Weapon, Boolean> weapons = new ObjectMap<Weapon, Boolean>();
|
||||
public static Weapon currentWeapon;
|
||||
|
||||
public static Player player;
|
||||
|
||||
public static float breaktime = 0;
|
||||
|
||||
public static final String[] maps = {"delta", "canyon", "pit", "maze"};
|
||||
public static Pixmap[] mapPixmaps;
|
||||
public static Texture[] mapTextures;
|
||||
public static int currentMap;
|
||||
public static int worldsize = 128;
|
||||
public static int pixsize = worldsize*tilesize;
|
||||
public static Tile[][] tiles = new Tile[worldsize][worldsize];
|
||||
|
||||
public static boolean hiscore = false;
|
||||
|
||||
public static Recipe recipe;
|
||||
public static int rotation;
|
||||
|
||||
public static int wave = 1;
|
||||
public static float wavetime;
|
||||
public static int enemies = 0;
|
||||
|
||||
public static float respawntime;
|
||||
|
||||
public static Tile core;
|
||||
public static Array<Tile> spawnpoints = new Array<Tile>();
|
||||
|
||||
public static boolean playing = false;
|
||||
public static boolean paused = false;
|
||||
public static boolean showedTutorial = false;
|
||||
|
||||
public static String[] aboutText = {
|
||||
"Made by [ROYAL]Anuken[] for the" + "\nGDL Metal Monstrosity jam.",
|
||||
|
||||
Reference in New Issue
Block a user