forked from SteamWar/SteamWar
Implement rest of Path Connections
This commit is contained in:
+46
-4
@@ -44,26 +44,68 @@ public class PathArea implements Region.Area {
|
|||||||
private static final File PATH_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/path");
|
private static final File PATH_DIR = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "sections/path");
|
||||||
private static final File FALLBACK_SCHEM = new File(PATH_DIR, "Fallback.schem");
|
private static final File FALLBACK_SCHEM = new File(PATH_DIR, "Fallback.schem");
|
||||||
|
|
||||||
private static final VariantSelector GARDEN = VariantSelector.Get(new File(PATH_DIR, "garden"));
|
|
||||||
private static final VariantSelector CENTER_NORMAL = VariantSelector.Get(new File(PATH_DIR, "center/normal"));
|
private static final VariantSelector CENTER_NORMAL = VariantSelector.Get(new File(PATH_DIR, "center/normal"));
|
||||||
|
|
||||||
private static final VariantSelector SIDE_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "side/global"));
|
private static final VariantSelector SIDE_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "side/global"));
|
||||||
private static final VariantSelector CORNER_INNER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "cinner/global"));
|
private static final VariantSelector CORNER_INNER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "cinner/global"));
|
||||||
private static final VariantSelector CORNER_OUTER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "couter/global"));
|
private static final VariantSelector CORNER_OUTER_GLOBAL = VariantSelector.Get(new File(PATH_DIR, "couter/global"));
|
||||||
|
|
||||||
|
private static final VariantSelector SIDE_WATER = VariantSelector.Get(new File(PATH_DIR, "side/water"));
|
||||||
|
private static final VariantSelector CORNER_INNER_WATER = VariantSelector.Get(new File(PATH_DIR, "cinner/water"));
|
||||||
|
private static final VariantSelector CORNER_OUTER_WATER = VariantSelector.Get(new File(PATH_DIR, "couter/water"));
|
||||||
|
|
||||||
|
private static final VariantSelector SIDE_CLOSED = VariantSelector.Get(new File(PATH_DIR, "side/closed"));
|
||||||
|
private static final VariantSelector CORNER_INNER_CLOSED = VariantSelector.Get(new File(PATH_DIR, "cinner/closed"));
|
||||||
|
private static final VariantSelector CORNER_OUTER_CLOSED = VariantSelector.Get(new File(PATH_DIR, "couter/closed"));
|
||||||
|
|
||||||
|
private static final VariantSelector GARDEN = VariantSelector.Get(new File(PATH_DIR, "garden"));
|
||||||
|
private static final VariantSelector SIDE_GARDEN = VariantSelector.Get(new File(PATH_DIR, "side/garden"));
|
||||||
|
private static final VariantSelector SIDE_GARDEN_CONNECTED = VariantSelector.Get(new File(PATH_DIR, "side/garden_connected"));
|
||||||
|
private static final VariantSelector CORNER_INNER_GARDEN = VariantSelector.Get(new File(PATH_DIR, "cinner/garden"));
|
||||||
|
private static final VariantSelector CORNER_OUTER_GARDEN = VariantSelector.Get(new File(PATH_DIR, "couter/garden"));
|
||||||
|
|
||||||
private static final SelectorSide SELECTOR_SIDE = new SelectorSide()
|
private static final SelectorSide SELECTOR_SIDE = new SelectorSide()
|
||||||
.Case(Path, CENTER_NORMAL)
|
.Case(Path, CENTER_NORMAL)
|
||||||
.Case(Global, SIDE_GLOBAL);
|
.Case(Global, SIDE_GLOBAL)
|
||||||
|
.Case(Water, SIDE_WATER)
|
||||||
|
.Case(Closed, SIDE_CLOSED)
|
||||||
|
.Case(Garden, SIDE_GARDEN_CONNECTED);
|
||||||
|
|
||||||
private static final SelectorCorner SELECTOR_CORNER = new SelectorCorner()
|
private static final SelectorCorner SELECTOR_CORNER = new SelectorCorner()
|
||||||
// Path to Global!
|
// Path to Path
|
||||||
|
.Case(Path, Path, Path, CENTER_NORMAL, RotationCorrection.UsingOrdinal)
|
||||||
|
// Path to Global
|
||||||
.Case(Path, Global, Global, SIDE_GLOBAL, RotationCorrection.WithCorrection)
|
.Case(Path, Global, Global, SIDE_GLOBAL, RotationCorrection.WithCorrection)
|
||||||
.Case(Global, Path, Path, SIDE_GLOBAL)
|
.Case(Global, Path, Path, SIDE_GLOBAL)
|
||||||
.Case(Global, Path, Global, SIDE_GLOBAL)
|
.Case(Global, Path, Global, SIDE_GLOBAL)
|
||||||
.Case(Path, Global, Path, SIDE_GLOBAL, RotationCorrection.WithCorrection)
|
.Case(Path, Global, Path, SIDE_GLOBAL, RotationCorrection.WithCorrection)
|
||||||
.Case(Path, Path, Path, CENTER_NORMAL, RotationCorrection.UsingOrdinal)
|
|
||||||
.Case(Global, Global, Global, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal)
|
.Case(Global, Global, Global, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal)
|
||||||
.Case(Global, Global, Path, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal)
|
.Case(Global, Global, Path, CORNER_OUTER_GLOBAL, RotationCorrection.UsingOrdinal)
|
||||||
.Case(Path, Path, Global, CORNER_INNER_GLOBAL, RotationCorrection.UsingOrdinal)
|
.Case(Path, Path, Global, CORNER_INNER_GLOBAL, RotationCorrection.UsingOrdinal)
|
||||||
|
// Path to Water
|
||||||
|
.Case(Path, Water, Water, SIDE_WATER, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Water, Path, Path, SIDE_WATER)
|
||||||
|
.Case(Water, Path, Water, SIDE_WATER)
|
||||||
|
.Case(Path, Water, Path, SIDE_WATER, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Water, Water, Water, CORNER_OUTER_WATER, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Water, Water, Path, CORNER_OUTER_WATER, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Path, Path, Water, CORNER_INNER_WATER, RotationCorrection.UsingOrdinal)
|
||||||
|
// Path to Closed
|
||||||
|
.Case(Path, Closed, Closed, SIDE_CLOSED, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Closed, Path, Path, SIDE_CLOSED)
|
||||||
|
.Case(Closed, Path, Closed, SIDE_CLOSED)
|
||||||
|
.Case(Path, Closed, Path, SIDE_CLOSED, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Closed, Closed, Closed, CORNER_OUTER_CLOSED, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Closed, Closed, Path, CORNER_OUTER_CLOSED, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Path, Path, Closed, CORNER_INNER_CLOSED, RotationCorrection.UsingOrdinal)
|
||||||
|
// Path to Garden
|
||||||
|
.Case(Path, Garden, Garden, SIDE_GARDEN, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Garden, Path, Path, SIDE_GARDEN)
|
||||||
|
.Case(Garden, Path, Garden, SIDE_GARDEN)
|
||||||
|
.Case(Path, Garden, Path, SIDE_GARDEN, RotationCorrection.WithCorrection)
|
||||||
|
.Case(Garden, Garden, Garden, CORNER_OUTER_GARDEN, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Garden, Garden, Path, CORNER_OUTER_GARDEN, RotationCorrection.UsingOrdinal)
|
||||||
|
.Case(Path, Path, Garden, CORNER_INNER_GARDEN, RotationCorrection.UsingOrdinal)
|
||||||
;
|
;
|
||||||
|
|
||||||
protected enum RotationCorrection {
|
protected enum RotationCorrection {
|
||||||
|
|||||||
Reference in New Issue
Block a user