read a .we minetest schema
- use ground has maze walls
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.artisanlogiciel.games.minetest;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Node {
|
||||
int x;
|
||||
int y;
|
||||
@@ -20,6 +22,16 @@ public class Node {
|
||||
this.material = Material.DEFAULT;
|
||||
}
|
||||
|
||||
public Node(HashMap<String, Object> map)
|
||||
throws ClassCastException, NullPointerException
|
||||
{
|
||||
// FIXME WARNING HACK reverse x and z ...
|
||||
x = ((Integer) map.get("x")).intValue();
|
||||
y = ((Integer) map.get("z")).intValue();
|
||||
z = ((Integer) map.get("y")).intValue();
|
||||
material = Material.getMaterialByName( (String) map.get("name"));
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
@@ -35,4 +47,14 @@ public class Node {
|
||||
public Material getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Node{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
", z=" + z +
|
||||
", material=" + material +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user