diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactorie.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactorie.java deleted file mode 100644 index 8409dac4ecfd80fb60f0d9fad2337efbfad775af..0000000000000000000000000000000000000000 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactorie.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.hdm_stuttgart.battlearena.Model.Map; - -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; - -public class TileFactorie { - - private static final Logger log = LogManager.getLogger(TileFactorie.class); - -} diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..842781646eb4c59e1ba537d172414c7437b498b2 --- /dev/null +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/Map/TileFactory.java @@ -0,0 +1,25 @@ +package de.hdm_stuttgart.battlearena.Model.Map; + +import javafx.scene.image.Image; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +public class TileFactory { + + private static final Logger log = LogManager.getLogger(TileFactory.class); + + public static ITile createTile(TileType tileType, Image tileSprite) { + if (tileType == TileType.WALKABLE) { + log.debug("Tile with type: " + tileType + " created."); + return new BackgroundTile(tileSprite, true); + } else if (tileType == TileType.NON_WALKABLE) { + log.debug("Tile with type: " + tileType + " created."); + return new BackgroundTile(tileSprite, false); + } + + log.error("TileType: " + tileType + " not supported!"); + throw new IllegalArgumentException("TileType: " + tileType + " not supported!"); + } + +} \ No newline at end of file diff --git a/src/main/resources/textures/map/stoneExampleTexture.png b/src/main/resources/textures/map/stoneExampleTexture.png new file mode 100644 index 0000000000000000000000000000000000000000..29dfde5c4e557cfd2b1e4dc536f774faabea40a0 Binary files /dev/null and b/src/main/resources/textures/map/stoneExampleTexture.png differ