diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java b/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java
index 0c3ac52f40fc1804d29017470e315eaffda5ee0c..fc0c24712a88999124dac75967302106f7a06401 100644 (file)
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
+import com.badlogic.gdx.utils.ArrayMap;
public class GameWorld {
private int WIDTH, HEIGHT;
+ private ArrayMap<String, Integer> metaMap;
private int[][] foreMap;
private int[][] backMap;
}
}
+ public int getMeta(int x, int y) {
+ if (metaMap.containsKey(x+"_"+y)) return metaMap.get(x+"_"+y);
+ else return 0;
+ }
+
+ public void setMeta(int x, int y, int value) {
+ if (metaMap.containsKey(x+"_"+y)) metaMap.removeKey(x+"_"+y);
+ metaMap.put(x+"_"+y, value);
+ }
+
public void placeToForeground(int x, int y, int value) {
if (getForeMap(x,y) == 0 || value == 0) {
setForeMap(x,y,value);
WorldGen.genWorld(WIDTH,HEIGHT);
foreMap = WorldGen.getForeMap();
backMap = WorldGen.getBackMap();
+ metaMap = new ArrayMap<String, Integer>();
WorldGen.clear();
}