diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java index 89cc5e9..8e4be3a 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java @@ -288,13 +288,13 @@ public class LobbyMenu extends Dialog { app.getGameLogic().playSound(Sound.BUTTON); switch (selected) { case "[0]": - figure = "Laptop"; + figure = "Computer"; break; case "[1]": figure = "Flugzeug"; break; case "[2]": - figure = "Jägermeister"; + figure = "Jaegermeister"; break; case "[3]": figure = "Katze"; @@ -303,7 +303,7 @@ public class LobbyMenu extends Dialog { figure = "OOP"; break; case "[5]": - figure = "Handyholster"; + figure = "Holster"; break; default: break; diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java index 8aff687..b1a02fb 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java @@ -5,11 +5,16 @@ import java.util.List; import java.util.Timer; import java.util.TimerTask; +import com.jme3.light.AmbientLight; +import com.jme3.light.DirectionalLight; +import com.jme3.material.Material; +import com.jme3.math.ColorRGBA; import com.jme3.math.FastMath; import com.jme3.math.Vector3f; import com.jme3.renderer.RenderManager; import com.jme3.renderer.ViewPort; import com.jme3.scene.control.AbstractControl; +import com.jme3.texture.Texture; import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.gui.popups.AcceptTrade; @@ -47,6 +52,7 @@ public class TestWorld implements GameEventListener { private PlayerHandler playerHandler; private CameraController cameraController; private Toolbar toolbar; + private List existingHouses = new ArrayList<>(); /** * Konstruktor für die TestWorld. @@ -74,6 +80,7 @@ public class TestWorld implements GameEventListener { //Füge Inhalte ein setSkyColor(); createBoard(); + addLighting(); createPlayerFigures(); toolbar = new Toolbar(app); toolbar.open(); @@ -94,9 +101,9 @@ public class TestWorld implements GameEventListener { com.jme3.scene.shape.Box box = new com.jme3.scene.shape.Box(10, 0.1f, 10); com.jme3.scene.Geometry geom = new com.jme3.scene.Geometry("Board", box); - com.jme3.material.Material mat = new com.jme3.material.Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); - com.jme3.texture.Texture texture = app.getAssetManager().loadTexture("Pictures/board2.png"); - mat.setTexture("ColorMap", texture); + Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md"); + Texture texture = app.getAssetManager().loadTexture("Pictures/board2.png"); + mat.setTexture("DiffuseMap", texture); geom.setMaterial(mat); geom.setLocalTranslation(0, -0.1f, 0); @@ -106,33 +113,49 @@ public class TestWorld implements GameEventListener { geom.setLocalRotation(rotation); app.getRootNode().attachChild(geom); - - System.out.println("Spielbrett erfolgreich erstellt, gedreht und hinzugefügt."); } catch (Exception e) { System.err.println("Fehler beim Erstellen des Spielfelds: " + e.getMessage()); } } + private void addLighting() { + // Direktionales Licht + DirectionalLight sun = new DirectionalLight(); + sun.setColor(ColorRGBA.White); + sun.setDirection(new Vector3f(-0.5f, -0.7f, -1.0f).normalizeLocal()); + app.getRootNode().addLight(sun); + + // Umgebungslicht + AmbientLight ambient = new AmbientLight(); + ambient.setColor(new ColorRGBA(0.6f, 0.6f, 0.6f, 1.0f)); + app.getRootNode().addLight(ambient); + } + /** * Erstellt die Spielfiguren basierend auf der bereits bekannten Spielerliste. */ private void createPlayerFigures() { - for (int i = 0; i < playerHandler.getPlayers().size(); i++) { - Player player = playerHandler.getPlayers().get(i); + for (Player player : playerHandler.getPlayers()) { try { + // Lade das Modell com.jme3.scene.Spatial model = app.getAssetManager().loadModel( - "models/" + player.getFigure().getType() + "/" + player.getFigure().getType() + ".j3o" - ); + "models/" + "Spielfiguren/" + player.getFigure().getType() + "/" + player.getFigure().getType() + ".j3o"); + + // Setze das Material mit silberner Farbe + Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md"); + //mat.setColor("Diffuse", new com.jme3.math.ColorRGBA(0.45f, 0.45f, 0.45f, 1.0f)); // Silberne Farbe + //mat.setColor("Specular", new com.jme3.math.ColorRGBA(0.6f, 0.6f, 0.6f, 1.0f)); // Glanzlicht + //mat.setFloat("Shininess", 64f); // Höhere Werte machen das Material glänzender + //model.setMaterial(mat); + + // Skaliere und positioniere das Modell model.setLocalScale(0.5f); - - int playerIndexOnField = calculatePlayerIndexOnField(player.getFieldID(), player.getId()); - Vector3f startPosition = calculateFieldPosition(player.getFieldID(), playerIndexOnField); + Vector3f startPosition = calculateFieldPosition(player.getFieldID(), player.getId()); model.setLocalTranslation(startPosition); - model.setName("PlayerFigure_" + player.getId()); + + // Füge das Modell zur Szene hinzu app.getRootNode().attachChild(model); - - System.out.println("Figur für Spieler " + player.getId() + " erstellt bei " + startPosition); } catch (Exception e) { System.err.println("Fehler beim Laden des Modells für Spieler " + player.getId() + ": " + e.getMessage()); } @@ -395,6 +418,105 @@ public class TestWorld implements GameEventListener { } } + private Vector3f calculateBuildingPosition(int fieldID) { + float baseX = 0.0f; + float baseZ = 0.0f; + + switch (fieldID) { + case 0: baseX = -8.4f; baseZ = -7.7f; break; + case 1: baseX = -6.3f; baseZ = -7.7f; break; + case 2: baseX = -4.7f; baseZ = -7.7f; break; + case 3: baseX = -3.1f; baseZ = -7.7f; break; + case 4: baseX = -1.4f; baseZ = -7.7f; break; + case 5: baseX = 0.2f; baseZ = -7.7f; break; + case 6: baseX = 1.8f; baseZ = -7.7f; break; + case 7: baseX = 3.5f; baseZ = -7.7f; break; + case 8: baseX = 5.1f; baseZ = -7.7f; break; + case 9: baseX = 6.7f; baseZ = -7.7f; break; + case 10: baseX = 8.2f; baseZ = -7.7f; break; + case 11: baseX = 8.2f; baseZ = -6.5f; break; //passt + case 12: baseX = 8.2f; baseZ = -4.9f; break; //passt + case 13: baseX = 8.2f; baseZ = -3.3f; break; //passt + case 14: baseX = 8.2f; baseZ = -1.6f; break; //passt + case 15: baseX = 8.2f; baseZ = 0.0f; break; //passt + case 16: baseX = 8.2f; baseZ = 1.6f; break; //passt + case 17: baseX = 8.2f; baseZ = 3.3f; break; //passt + case 18: baseX = 8.2f; baseZ = 4.9f; break; //passt + case 19: baseX = 8.2f; baseZ = 6.5f; break; //passt + case 20: baseX = 8.2f; baseZ = 7.7f; break; + case 21: baseX = 6.5f; baseZ = 7.7f; break; + case 22: baseX = 4.9f; baseZ = 7.7f; break; + case 23: baseX = 3.3f; baseZ = 7.7f; break; + case 24: baseX = 1.6f; baseZ = 7.7f; break; + case 25: baseX = 0.0f; baseZ = 7.7f; break; + case 26: baseX = -1.6f; baseZ = 7.7f; break; + case 27: baseX = -3.3f; baseZ = 7.7f; break; + case 28: baseX = -4.9f; baseZ = 7.7f; break; + case 29: baseX = -6.5f; baseZ = 7.7f; break; + case 30: baseX = -7.2f; baseZ = 7.7f; break; + case 31: baseX = -7.2f; baseZ = 6.5f; break; + case 32: baseX = -7.2f; baseZ = 4.9f; break; + case 33: baseX = -7.2f; baseZ = 3.3f; break; + case 34: baseX = -7.2f; baseZ = 1.6f; break; + case 35: baseX = -7.2f; baseZ = 0.0f; break; + case 36: baseX = -7.2f; baseZ = -1.6f; break; + case 37: baseX = -7.2f; baseZ = -3.3f; break; + case 38: baseX = -7.2f; baseZ = -4.9f; break; + case 39: baseX = -7.2f; baseZ = -6.5f; break; + default: throw new IllegalArgumentException("Ungültige Feld-ID: " + fieldID); + } + + return new Vector3f(baseX, 0, baseZ); + } + + private void updateHousesOnBoard() { + app.enqueue(() -> { + List propertiesWithBuildings = app.getGameLogic().getBoardManager().getPropertiesWithBuildings(); + + for (BuildingProperty property : propertiesWithBuildings) { + int houseCount = property.getHouses(); + int hotelCount = property.getHotel(); + + String uniqueIdentifier = "Building_" + property.getId() + "_" + (hotelCount > 0 ? "Hotel" : houseCount); + + if (existingHouses.contains(uniqueIdentifier)) continue; + + try { + String modelPath = hotelCount > 0 + ? "models/Hotel/Hotel.j3o" + : "models/Haus/" + houseCount + "Haus.j3o"; + + com.jme3.scene.Spatial buildingModel = app.getAssetManager().loadModel(modelPath); + + Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Light/Lighting.j3md"); + + buildingModel.setMaterial(mat); + + buildingModel.setLocalScale(0.5f); + Vector3f position = calculateBuildingPosition(property.getId()).add(0, 0.5f, 0); + buildingModel.setLocalTranslation(position); + + com.jme3.math.Quaternion rotation = new com.jme3.math.Quaternion(); + if (property.getId() >= 1 && property.getId() <= 10) { + rotation.fromAngleAxis(FastMath.HALF_PI, Vector3f.UNIT_Y); + } else if (property.getId() >= 21 && property.getId() <= 30) { + rotation.fromAngleAxis(3 * FastMath.HALF_PI, Vector3f.UNIT_Y); + } else if (property.getId() >= 31 && property.getId() <= 39) { + rotation.fromAngleAxis(FastMath.PI, Vector3f.UNIT_Y); + } + + buildingModel.setLocalRotation(rotation); + buildingModel.setName(uniqueIdentifier); + app.getRootNode().attachChild(buildingModel); + existingHouses.add(uniqueIdentifier); + + } catch (Exception e) { + System.err.println("Fehler beim Hinzufügen eines Gebäudes: " + e.getMessage()); + } + } + }); + } + @Override public void receivedEvent(EventCardEvent event) { Timer timer = new Timer(); @@ -412,5 +534,6 @@ public class TestWorld implements GameEventListener { for (Player player : playerHandler.getPlayers()) { movePlayerFigure(player); } + updateHousesOnBoard(); } } diff --git a/Projekte/monopoly/client/src/main/resources/models/Handyholster/Handyholster.j3o b/Projekte/monopoly/client/src/main/resources/models/Handyholster/Handyholster.j3o deleted file mode 100644 index 0cd2049..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Handyholster/Handyholster.j3o and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Haus/1Haus.j3o b/Projekte/monopoly/client/src/main/resources/models/Haus/1Haus.j3o index 7056998..58cddb8 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Haus/1Haus.j3o and b/Projekte/monopoly/client/src/main/resources/models/Haus/1Haus.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Haus/2Haus.j3o b/Projekte/monopoly/client/src/main/resources/models/Haus/2Haus.j3o index 7d59289..5d9230e 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Haus/2Haus.j3o and b/Projekte/monopoly/client/src/main/resources/models/Haus/2Haus.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Haus/3Haus.j3o b/Projekte/monopoly/client/src/main/resources/models/Haus/3Haus.j3o index df78569..067a047 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Haus/3Haus.j3o and b/Projekte/monopoly/client/src/main/resources/models/Haus/3Haus.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Haus/4Haus.j3o b/Projekte/monopoly/client/src/main/resources/models/Haus/4Haus.j3o index 1a63203..353533b 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Haus/4Haus.j3o and b/Projekte/monopoly/client/src/main/resources/models/Haus/4Haus.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Haus/white-brick-wall_ao.png b/Projekte/monopoly/client/src/main/resources/models/Haus/white-brick-wall_ao.png deleted file mode 100644 index 73095b0..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Haus/white-brick-wall_ao.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Hotel/Hotel.j3o b/Projekte/monopoly/client/src/main/resources/models/Hotel/Hotel.j3o index ffbe354..05023ae 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Hotel/Hotel.j3o and b/Projekte/monopoly/client/src/main/resources/models/Hotel/Hotel.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_metallicRoughness.png b/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_metallicRoughness.png deleted file mode 100644 index de1782a..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_metallicRoughness.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_transmission.png b/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_transmission.png deleted file mode 100644 index b209454..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_transmission.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Gemeinschaftskarten.j3o b/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Gemeinschaftskarten.j3o deleted file mode 100644 index a074a07..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Gemeinschaftskarten.j3o and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ereigniskarten_Deck.j3o b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ereigniskarten_Deck.j3o new file mode 100644 index 0000000..e72a650 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ereigniskarten_Deck.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Ereigniskarten.j3o b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Gemeinschaftskarten_Deck.j3o similarity index 67% rename from Projekte/monopoly/client/src/main/resources/models/Kartendeck/Ereigniskarten.j3o rename to Projekte/monopoly/client/src/main/resources/models/Kartendecks/Gemeinschaftskarten_Deck.j3o index acf8911..d6ccb96 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Ereigniskarten.j3o and b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Gemeinschaftskarten_Deck.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Rücken_Gemeinschaftskarte.png b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ruecken_Gemeinschaftskarte.png similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Kartendeck/Rücken_Gemeinschaftskarte.png rename to Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ruecken_Gemeinschaftskarte.png diff --git a/Projekte/monopoly/client/src/main/resources/models/Kartendeck/Rücken_Karte.png b/Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ruecken_Karte.png similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Kartendeck/Rücken_Karte.png rename to Projekte/monopoly/client/src/main/resources/models/Kartendecks/Ruecken_Karte.png diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_0.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_0.png deleted file mode 100644 index ad84902..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_0.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_1.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_1.png deleted file mode 100644 index 6fb6267..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_1.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_2.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_2.png deleted file mode 100644 index 1b2edd4..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_2.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_3.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_3.png deleted file mode 100644 index 42d3ee1..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_3.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_4.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_4.png deleted file mode 100644 index c542720..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_4.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_5.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_5.png deleted file mode 100644 index 7766e18..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_5.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_6.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_6.png deleted file mode 100644 index 2a52719..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_6.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_7.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_7.png deleted file mode 100644 index 70dc6a9..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_7.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_8.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_8.png deleted file mode 100644 index aa1714b..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_8.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_9.png b/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_9.png deleted file mode 100644 index 8869e85..0000000 Binary files a/Projekte/monopoly/client/src/main/resources/models/Laptop/gltf_embedded_9.png and /dev/null differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Laptop/Laptop.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Computer/Computer.j3o similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Laptop/Laptop.j3o rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Computer/Computer.j3o diff --git a/Projekte/monopoly/client/src/main/resources/models/Flugzeug/Flugzeug.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Flugzeug/Flugzeug.j3o similarity index 99% rename from Projekte/monopoly/client/src/main/resources/models/Flugzeug/Flugzeug.j3o rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Flugzeug/Flugzeug.j3o index 8e83de3..b673cb5 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Flugzeug/Flugzeug.j3o and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Flugzeug/Flugzeug.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Holster/Holster.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Holster/Holster.j3o new file mode 100644 index 0000000..133da68 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Holster/Holster.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Handyholster/black-leather_albedo.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Holster/black-leather_albedo.png similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Handyholster/black-leather_albedo.png rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Holster/black-leather_albedo.png diff --git a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_baseColor.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Atlas_baseColor.png similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_baseColor.png rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Atlas_baseColor.png diff --git a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_normal.jpeg b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Atlas_normal.jpeg similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/Jägermeister/Atlas_normal.jpeg rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Atlas_normal.jpeg diff --git a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Jagermeister.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Jaegermeister.j3o similarity index 92% rename from Projekte/monopoly/client/src/main/resources/models/Jägermeister/Jagermeister.j3o rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Jaegermeister.j3o index 79b6673..c545324 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/Jägermeister/Jagermeister.j3o and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Jaegermeister/Jaegermeister.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Katze.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Katze.j3o new file mode 100644 index 0000000..ee4663e Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Katze.j3o differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Base_Color.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Base_Color.png new file mode 100644 index 0000000..20df310 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Base_Color.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=B.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=B.png new file mode 100644 index 0000000..4c8bb13 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=B.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=G.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=G.png new file mode 100644 index 0000000..121958c Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/Kitty_001_MI_Metallic-Kitty_001_MI_Roughness@channels=G.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Base_Color.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Base_Color.png new file mode 100644 index 0000000..8d3075d Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Base_Color.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=B.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=B.png new file mode 100644 index 0000000..f2a017c Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=B.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=G.png b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=G.png new file mode 100644 index 0000000..38116ef Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/Katze/alb_001_Metallic-alb_001_Roughness@channels=G.png differ diff --git a/Projekte/monopoly/client/src/main/resources/models/OOP/Durchgefallen.jpg b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/OOP/Durchgefallen.jpg similarity index 100% rename from Projekte/monopoly/client/src/main/resources/models/OOP/Durchgefallen.jpg rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/OOP/Durchgefallen.jpg diff --git a/Projekte/monopoly/client/src/main/resources/models/OOP/OOP.j3o b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/OOP/OOP.j3o similarity index 85% rename from Projekte/monopoly/client/src/main/resources/models/OOP/OOP.j3o rename to Projekte/monopoly/client/src/main/resources/models/Spielfiguren/OOP/OOP.j3o index a2368b9..d82e1a9 100644 Binary files a/Projekte/monopoly/client/src/main/resources/models/OOP/OOP.j3o and b/Projekte/monopoly/client/src/main/resources/models/Spielfiguren/OOP/OOP.j3o differ diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BoardManager.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BoardManager.java index 53a5665..9ff130d 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BoardManager.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BoardManager.java @@ -3,7 +3,6 @@ package pp.monopoly.model.fields; import java.util.ArrayList; import java.util.List; import java.util.NoSuchElementException; -import java.util.stream.Collector; import java.util.stream.Collectors; import com.jme3.network.serializing.Serializable; @@ -180,5 +179,17 @@ public class BoardManager { return groupProperties.stream() .allMatch(bp -> bp.getHouses() <= currentHouses); } + + /** + * Gibt eine Liste von BuildingProperty-Feldern zurück, auf denen Häuser oder Hotels stehen. + * @return Liste von BuildingProperty-Feldern mit Gebäuden + */ + public List getPropertiesWithBuildings() { + return board.stream() + .filter(f -> f instanceof BuildingProperty) + .map(f -> (BuildingProperty) f) + .filter(bp -> bp.getHouses() > 0 || bp.getHotel() > 0) + .collect(Collectors.toList()); + } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BuildingProperty.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BuildingProperty.java index f289e14..3fc9839 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BuildingProperty.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/fields/BuildingProperty.java @@ -10,7 +10,7 @@ import pp.monopoly.game.server.Player; @Serializable public class BuildingProperty extends PropertyField { - private int houses = 2; + private int houses; private final int housePrice; private final FieldColor color; private final int rentFactor1 = 5;