diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionCommand.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionCommand.java index 77ec258d..f23c2e1d 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionCommand.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/DynamicRegionCommand.java @@ -22,10 +22,10 @@ package de.steamwar.bausystem.region; import de.steamwar.bausystem.features.region.RegionCommand; import de.steamwar.bausystem.region.dynamic.DynamicRegion; import de.steamwar.bausystem.region.dynamic.TileUtils; -import de.steamwar.bausystem.region.dynamic.normal.work.MicroWarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.MiniWarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.WarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.WarShip21Region; +import de.steamwar.bausystem.region.dynamic.normal.work.MicroWarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.MiniWarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.WarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.WarShip21WorkRegion; import de.steamwar.bausystem.region.dynamic.path.PathRegion; import de.steamwar.bausystem.shared.Pair; import de.steamwar.bausystem.utils.PasteBuilder; @@ -99,10 +99,10 @@ public class DynamicRegionCommand extends SWCommand { @RequiredArgsConstructor public enum Placement { Path(PathRegion::new, 19, 19), - WarGear21(WarGear21Region::new, WarGear21Region.widthX, WarGear21Region.widthZ), - MiniWarGear21(MiniWarGear21Region::new, MiniWarGear21Region.widthX, MiniWarGear21Region.widthZ), - WarShip21(WarShip21Region::new, WarShip21Region.widthX, WarShip21Region.widthZ), - MicroWarGear21(MicroWarGear21Region::new, MicroWarGear21Region.widthX, MicroWarGear21Region.widthZ), + WarGear21(WarGear21WorkRegion::new, WarGear21WorkRegion.widthX, WarGear21WorkRegion.widthZ), + MiniWarGear21(MiniWarGear21WorkRegion::new, MiniWarGear21WorkRegion.widthX, MiniWarGear21WorkRegion.widthZ), + WarShip21(WarShip21WorkRegion::new, WarShip21WorkRegion.widthX, WarShip21WorkRegion.widthZ), + MicroWarGear21(MicroWarGear21WorkRegion::new, MicroWarGear21WorkRegion.widthX, MicroWarGear21WorkRegion.widthZ), ; private final BiFunction constructor; diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/RegionDataRepository.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/RegionDataRepository.java index 18a583b2..7da42807 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/RegionDataRepository.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/RegionDataRepository.java @@ -21,7 +21,6 @@ package de.steamwar.bausystem.region.dynamic; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.google.gson.JsonSyntaxException; import com.google.gson.stream.JsonWriter; import com.sk89q.worldedit.EditSession; import de.steamwar.bausystem.region.FlagStorage; @@ -29,10 +28,10 @@ import de.steamwar.bausystem.region.Point; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.RegionBackups; import de.steamwar.bausystem.region.dynamic.normal.NormalFlagStorage; -import de.steamwar.bausystem.region.dynamic.normal.work.MicroWarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.MiniWarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.WarGear21Region; -import de.steamwar.bausystem.region.dynamic.normal.work.WarShip21Region; +import de.steamwar.bausystem.region.dynamic.normal.work.MicroWarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.MiniWarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.WarGear21WorkRegion; +import de.steamwar.bausystem.region.dynamic.normal.work.WarShip21WorkRegion; import de.steamwar.bausystem.region.dynamic.path.PathRegion; import de.steamwar.bausystem.region.dynamic.spawn.SpawnPathRegion; import de.steamwar.bausystem.region.dynamic.spawn.SpawnRegion; @@ -73,10 +72,14 @@ public class RegionDataRepository { regionCreators.put(SpawnRegion.class.getSimpleName(), SpawnRegion::new); regionCreators.put(SpawnPathRegion.class.getSimpleName(), SpawnPathRegion::new); regionCreators.put(PathRegion.class.getSimpleName(), PathRegion::new); - regionCreators.put(WarGear21Region.class.getSimpleName(), WarGear21Region::new); - regionCreators.put(MiniWarGear21Region.class.getSimpleName(), MiniWarGear21Region::new); - regionCreators.put(WarShip21Region.class.getSimpleName(), WarShip21Region::new); - regionCreators.put(MicroWarGear21Region.class.getSimpleName(), MicroWarGear21Region::new); + regionCreators.put(WarGear21WorkRegion.class.getSimpleName(), WarGear21WorkRegion::new); + regionCreators.put("WarGear21Region", WarGear21WorkRegion::new); // TODO: Legacy because of rename + regionCreators.put(MiniWarGear21WorkRegion.class.getSimpleName(), MiniWarGear21WorkRegion::new); + regionCreators.put("MiniWarGear21Region", MiniWarGear21WorkRegion::new); // TODO: Legacy because of rename + regionCreators.put(WarShip21WorkRegion.class.getSimpleName(), WarShip21WorkRegion::new); + regionCreators.put("WarShip21Region", WarShip21WorkRegion::new); // TODO: Legacy because of rename + regionCreators.put(MicroWarGear21WorkRegion.class.getSimpleName(), MicroWarGear21WorkRegion::new); + regionCreators.put("MicroWarGear21Region", MicroWarGear21WorkRegion::new); // TODO: Legacy because of rename } static { diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21Region.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21WorkRegion.java similarity index 92% rename from BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21Region.java rename to BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21WorkRegion.java index 03f95a43..afa1375e 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21Region.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MicroWarGear21WorkRegion.java @@ -30,7 +30,7 @@ import org.bukkit.Bukkit; import java.io.File; -public class MicroWarGear21Region extends WorkRegion { +public class MicroWarGear21WorkRegion extends WorkRegion { public static final int widthX = 57; public static final int widthZ = 114; @@ -43,7 +43,7 @@ public class MicroWarGear21Region extends WorkRegion { @Getter private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement - public MicroWarGear21Region(int minX, int minZ) { + public MicroWarGear21WorkRegion(int minX, int minZ) { super(minX, minZ); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 25, 32, minZ + 25, 7, 7, 7, null, false, this); @@ -52,7 +52,7 @@ public class MicroWarGear21Region extends WorkRegion { testblock = TESTBLOCK_FILE; } - public MicroWarGear21Region(RegionConstructorData regionConstructorData) { + public MicroWarGear21WorkRegion(RegionConstructorData regionConstructorData) { super(regionConstructorData); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 25, 32, minZ + 25, 7, 7, 7, null, false, this); diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21Region.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21WorkRegion.java similarity index 93% rename from BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21Region.java rename to BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21WorkRegion.java index d0f5a5de..b36bd740 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21Region.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/MiniWarGear21WorkRegion.java @@ -30,7 +30,7 @@ import org.bukkit.Bukkit; import java.io.File; -public class MiniWarGear21Region extends WorkRegion { +public class MiniWarGear21WorkRegion extends WorkRegion { public static final int widthX = 95; public static final int widthZ = 152; @@ -43,7 +43,7 @@ public class MiniWarGear21Region extends WorkRegion { @Getter private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement - public MiniWarGear21Region(int minX, int minZ) { + public MiniWarGear21WorkRegion(int minX, int minZ) { super(minX, minZ); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 29, 32, minZ + 29, 37, 26, 22, null, false, this); @@ -52,7 +52,7 @@ public class MiniWarGear21Region extends WorkRegion { testblock = TESTBLOCK_FILE; } - public MiniWarGear21Region(RegionConstructorData regionConstructorData) { + public MiniWarGear21WorkRegion(RegionConstructorData regionConstructorData) { super(regionConstructorData); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 29, 32, minZ + 29, 37, 26, 22, null, false, this); diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21Region.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21WorkRegion.java similarity index 93% rename from BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21Region.java rename to BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21WorkRegion.java index cf88f6fe..f7c70ab1 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21Region.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarGear21WorkRegion.java @@ -30,7 +30,7 @@ import org.bukkit.Bukkit; import java.io.File; -public class WarGear21Region extends WorkRegion { +public class WarGear21WorkRegion extends WorkRegion { public static final int widthX = 133; public static final int widthZ = 228; @@ -43,7 +43,7 @@ public class WarGear21Region extends WorkRegion { @Getter private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement - public WarGear21Region(int minX, int minZ) { + public WarGear21WorkRegion(int minX, int minZ) { super(minX, minZ); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this); @@ -52,7 +52,7 @@ public class WarGear21Region extends WorkRegion { testblock = TESTBLOCK_FILE; } - public WarGear21Region(RegionConstructorData regionConstructorData) { + public WarGear21WorkRegion(RegionConstructorData regionConstructorData) { super(regionConstructorData); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this); diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21Region.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21WorkRegion.java similarity index 93% rename from BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21Region.java rename to BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21WorkRegion.java index 56d9d516..bb7e3e34 100644 --- a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21Region.java +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/normal/work/WarShip21WorkRegion.java @@ -30,7 +30,7 @@ import org.bukkit.Bukkit; import java.io.File; -public class WarShip21Region extends WorkRegion { +public class WarShip21WorkRegion extends WorkRegion { public static final int widthX = 285; public static final int widthZ = 228; @@ -43,7 +43,7 @@ public class WarShip21Region extends WorkRegion { @Getter private final RegionConfig gameModeConfig = new RegionConfig(null); // TODO: Implement - public WarShip21Region(int minX, int minZ) { + public WarShip21WorkRegion(int minX, int minZ) { super(minX, minZ); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); // northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this); @@ -52,7 +52,7 @@ public class WarShip21Region extends WorkRegion { testblock = TESTBLOCK_FILE; } - public WarShip21Region(RegionConstructorData regionConstructorData) { + public WarShip21WorkRegion(RegionConstructorData regionConstructorData) { super(regionConstructorData); area = new WorkArea(minX, 0, minZ, widthX, 255, widthZ, REGION_FILE, false, this); // northArea = new WorkArea(minX + 33, 32, minZ + 42, 67, 41, 47, null, false, this); diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/DrySpecialRegion.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/DrySpecialRegion.java new file mode 100644 index 00000000..ad5ab911 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/DrySpecialRegion.java @@ -0,0 +1,23 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.special; + +public class DrySpecialRegion { +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialAreaTile.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialAreaTile.java new file mode 100644 index 00000000..149b3d34 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialAreaTile.java @@ -0,0 +1,23 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.special; + +public class SpecialAreaTile { +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegion.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegion.java new file mode 100644 index 00000000..badaffe9 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/SpecialRegion.java @@ -0,0 +1,23 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.special; + +public class SpecialRegion { +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/WetSpecialRegion.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/WetSpecialRegion.java new file mode 100644 index 00000000..b24e20df --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/special/WetSpecialRegion.java @@ -0,0 +1,23 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.special; + +public class WetSpecialRegion { +} diff --git a/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/variants/VariantSelector.java b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/variants/VariantSelector.java new file mode 100644 index 00000000..bfe66b04 --- /dev/null +++ b/BauSystem/BauSystem_RegionDynamic/src/de/steamwar/bausystem/region/dynamic/variants/VariantSelector.java @@ -0,0 +1,32 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2020 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.region.dynamic.variants; + +import java.io.File; +import java.util.Optional; + +public interface VariantSelector { + + Optional selectVariant(int minX, int minZ); + + default VariantSelector or(VariantSelector other) { + return (minX, minZ) -> selectVariant(minX, minZ).or(() -> other.selectVariant(minX, minZ)); + } +}