SteamWar/BauSystem2.0
Archiviert
12
0

Implement Prototype creation

Dieser Commit ist enthalten in:
yoyosource 2021-04-18 15:22:18 +02:00
Ursprung c39eb4dda6
Commit 435e986777

Datei anzeigen

@ -22,9 +22,16 @@ package de.steamwar.bausystem.region;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import java.io.File; import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class Prototype { public class Prototype {
private static final Map<String, Prototype> PROTOTYPE_MAP = new HashMap<>();
private final String name;
private final String displayName;
private final int sizeX; private final int sizeX;
private final int sizeY; private final int sizeY;
private final int sizeZ; private final int sizeZ;
@ -37,7 +44,12 @@ public class Prototype {
private final SubPrototype testblock; private final SubPrototype testblock;
private final SubPrototype build; private final SubPrototype build;
public Prototype(YAPIONObject yapionObject) { public Prototype(String name, YAPIONObject yapionObject) {
PROTOTYPE_MAP.put(name, this);
this.name = name;
displayName = yapionObject.getPlainValueOrDefault("displayName", name);
sizeX = yapionObject.getPlainValue("sizeX"); sizeX = yapionObject.getPlainValue("sizeX");
sizeY = yapionObject.getPlainValue("sizeY"); sizeY = yapionObject.getPlainValue("sizeY");
sizeZ = yapionObject.getPlainValue("sizeZ"); sizeZ = yapionObject.getPlainValue("sizeZ");
@ -105,7 +117,10 @@ public class Prototype {
extensionPositiveZ = yapionObject.getPlainValueOrDefault("extensionPositiveZ", 0); extensionPositiveZ = yapionObject.getPlainValueOrDefault("extensionPositiveZ", 0);
} }
} }
}
public Region generateRegion() {
return null;
} }
} }