read a .we minetest schema

- use ground has maze walls
This commit is contained in:
philippe lhardy
2020-11-04 22:12:17 +01:00
parent 6402766371
commit 52a2d3f1e3
13 changed files with 430 additions and 16 deletions

View File

@@ -0,0 +1,50 @@
package org.artisanlogiciel.games.minetest;
import java.util.HashMap;
public class Slice
extends Range
{
// x is index
HashMap<Integer, Raw> raws;
public Range getRawRange() {
return rawRange;
}
Range rawRange;
public Slice() {
super();
raws = new HashMap<>();
rawRange = new Range();
}
public void addNodeInRaw(Integer x, Node node) {
updateBounds(x.intValue());
Raw r = raws.get(x);
if ( r == null )
{
r = new Raw();
raws.put(x,r);
}
r.addNode(new Integer(node.getY()), node);
rawRange.union(r);
}
public Node getNode(int x, int y)
{
Raw r = raws.get(x);
if ( r == null )
{
return null;
}
return r.getNode(y);
}
public Raw getRaw(Integer x)
{
return raws.get(x);
}
}