diff --git a/Dokumente/.$Klassendiagramm_battleship_client_Feyer.drawio.bkp b/Dokumente/.$Klassendiagramm_battleship_client_Feyer.drawio.bkp
new file mode 100644
index 00000000..8782b4ba
--- /dev/null
+++ b/Dokumente/.$Klassendiagramm_battleship_client_Feyer.drawio.bkp
@@ -0,0 +1,528 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/.$Klassendiagramm_battleship_model_Feyer.drawio.bkp b/Dokumente/.$Klassendiagramm_battleship_model_Feyer.drawio.bkp
new file mode 100644
index 00000000..425e7faa
--- /dev/null
+++ b/Dokumente/.$Klassendiagramm_battleship_model_Feyer.drawio.bkp
@@ -0,0 +1,527 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/State_Diagram_Feyer.drawio b/Dokumente/.$State_Diagram_Feyer.drawio.bkp
similarity index 100%
rename from Dokumente/State_Diagram_Feyer.drawio
rename to Dokumente/.$State_Diagram_Feyer.drawio.bkp
diff --git a/Dokumente/Feyer_Benjamin_BPMN_Diagramm.drawio.png b/Dokumente/Feyer_Benjamin_BPMN_Diagramm.drawio.png
new file mode 100644
index 00000000..2efeb15b
Binary files /dev/null and b/Dokumente/Feyer_Benjamin_BPMN_Diagramm.drawio.png differ
diff --git a/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio b/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio
new file mode 100644
index 00000000..68b67a97
--- /dev/null
+++ b/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio
@@ -0,0 +1,475 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio.png b/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio.png
new file mode 100644
index 00000000..b54f2ef0
Binary files /dev/null and b/Dokumente/Klassendiagramm_battleship_client_Feyer.drawio.png differ
diff --git a/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio b/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio
new file mode 100644
index 00000000..87b413ef
--- /dev/null
+++ b/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio
@@ -0,0 +1,527 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio.png b/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio.png
new file mode 100644
index 00000000..4d6dd49b
Binary files /dev/null and b/Dokumente/Klassendiagramm_battleship_model_Feyer.drawio.png differ
diff --git a/Dokumente/State_Diagram_Server_Feyer.drawio b/Dokumente/State_Diagram_Server_Feyer.drawio
new file mode 100644
index 00000000..008f0ceb
--- /dev/null
+++ b/Dokumente/State_Diagram_Server_Feyer.drawio
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/State_Diagram_Server_Feyer.drawio.png b/Dokumente/State_Diagram_Server_Feyer.drawio.png
new file mode 100644
index 00000000..69e3172c
Binary files /dev/null and b/Dokumente/State_Diagram_Server_Feyer.drawio.png differ
diff --git a/Dokumente/State_Diagramm_Client.drawio b/Dokumente/State_Diagramm_Client.drawio
new file mode 100644
index 00000000..b6d5cc83
--- /dev/null
+++ b/Dokumente/State_Diagramm_Client.drawio
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Dokumente/State_Diagramm_Client.drawio.png b/Dokumente/State_Diagramm_Client.drawio.png
new file mode 100644
index 00000000..f587c543
Binary files /dev/null and b/Dokumente/State_Diagramm_Client.drawio.png differ
diff --git a/Projekte/battleship/client/client.properties b/Projekte/battleship/client/client.properties
index 4403fa3b..89d59df4 100644
--- a/Projekte/battleship/client/client.properties
+++ b/Projekte/battleship/client/client.properties
@@ -9,7 +9,7 @@
#
# Specifies the map used by the opponent in single mode.
# Single mode is activated if this property is set.
-#map.opponent=maps/map2.json
+map.opponent=maps/map2.json
#
# Specifies the map used by the player in single mode.
# The player must define their own map if this property is not set.
diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/GameSound.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/GameSound.java
index ae956afe..59ed562b 100644
--- a/Projekte/battleship/client/src/main/java/pp/battleship/client/GameSound.java
+++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/GameSound.java
@@ -124,6 +124,11 @@ public void shipDestroyed() {
shipDestroyedSound.playInstance();
}
+ /**
+ * when triggered, though a sound-event,it decides, which sound should be played
+ *
+ * @param event the received event
+ */
@Override
public void receivedEvent(SoundEvent event) {
switch (event.sound()) {
@@ -140,7 +145,7 @@ public void receivedEvent(SoundEvent event) {
*/
private void rocket() {
if (isEnabled() && splashSound != null)
- rocketSound.playInstance();
+ rocketSound.play();
}
/**
diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/SeaSynchronizer.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/SeaSynchronizer.java
index 6336ddec..c3f3b8ba 100644
--- a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/SeaSynchronizer.java
+++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/SeaSynchronizer.java
@@ -43,17 +43,14 @@ class SeaSynchronizer extends ShipMapSynchronizer {
private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
- private static final String SUBMARINE = "Models/Submarine/submarine.obj";
- private static final String DESTROYER = "Models/Destroyer/10619_Battleship.obj";
+ private static final String SUBMARINE = "Models/Submarine/submarine.j3o";
+ private static final String DESTROYER = "Models/Destroyer/10619_Battleship.j3o";
private static final String SMALL_SHIP = "Models/SmallShip/10634_SpeedBoat_v01_LOD3.obj";
private static final String PARTICLE = "Common/MatDefs/Misc/Particle.j3md";
private static final String COLOR = "Color"; //NON-NLS
private static final String SHIP = "ship"; //NON-NLS
- private static final String SHOT = "shot"; //NON-NLS
private static final String ROCKET = "Models/Rocket/rocket.j3o";
private static final ColorRGBA BOX_COLOR = ColorRGBA.Gray;
- private static final ColorRGBA SPLASH_COLOR = new ColorRGBA(0f, 0f, 1f, 0.4f);
- private static final ColorRGBA HIT_COLOR = new ColorRGBA(1f, 0f, 0f, 0.4f);
private final ShipMap map;
private final BattleshipApp app;
@@ -123,27 +120,28 @@ private Spatial handleHit(Shot shot) {
* @param shot the shot, that hit the ship
* @return the Fire
*/
-
private ParticleEmitter createFire(Shot shot) {
- ParticleEmitter hitEffect = new ParticleEmitter("HitEffect", Type.Triangle, 5000);
+ ParticleEmitter hitEffect = new ParticleEmitter("fire", Type.Triangle, 5000);
hitEffect.setMaterial(new Material(app.getAssetManager(), PARTICLE));
hitEffect.setImagesX(2);
hitEffect.setImagesY(2);
hitEffect.setStartColor(ColorRGBA.Orange);
hitEffect.setEndColor(ColorRGBA.Red);
hitEffect.setStartSize(0.1f);
- hitEffect.setEndSize(0.1f);
- hitEffect.setParticlesPerSec(2);
+ hitEffect.setEndSize(0.05f);
+ hitEffect.getParticleInfluencer().setInitialVelocity(new Vector3f(0,1,0));
+ hitEffect.setParticlesPerSec(5);
hitEffect.setLowLife(1f);
hitEffect.setHighLife(1f);
final Node shipNode = requireNonNull((Node) getSpatial(map.findShipAt(shot.getX(), shot.getY())), "Missing ship node");
+ hitEffect.setGravity(0, -0.9f, 0);
Vector3f shipNodePos = shipNode.getLocalTranslation();
Vector3f shotWorld = mapToWorldCord(shot.getX(), shot.getY());
Vector3f firePos = shotWorld.subtract(shipNodePos);
if (map.findShipAt(shot.getX(), shot.getY()).getLength() == 2) {
- hitEffect.setLocalTranslation(firePos.x, 0.25f, firePos.z);
+ hitEffect.setLocalTranslation(firePos.x, 0.15f, firePos.z);
} else {
- hitEffect.setLocalTranslation(firePos.x, 0.5f, firePos.z);
+ hitEffect.setLocalTranslation(firePos.x, 0.3f, firePos.z);
}
return hitEffect;
}
@@ -262,7 +260,7 @@ private Spatial createShell() {
LOGGER.log(Level.INFO, "created Shell");
final Spatial model = app.getAssetManager().loadModel(ROCKET);
model.rotate(PI, PI, 0);
- model.scale(0.0005f);
+ model.scale(0.0002f);
model.move(0, 0, 0);
model.setShadowMode(ShadowMode.CastAndReceive);
return model;
diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java
index 6ea7ca41..2ad00582 100644
--- a/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java
+++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/gui/ShipControl.java
@@ -94,13 +94,17 @@ public ShipControl(Battleship ship, ShipMap map) {
protected void controlUpdate(float tpf) {
// If spatial is null, do nothing
if (spatial == null) return;
- if (ship.isDestroyed() && spatial.getLocalTranslation().getY() < SINKING_HEIGHT) { // removes the ship, if it is completely sunk
- spatial.getParent().detachChild(spatial);
- }
- else if (ship.isDestroyed() && spatial.getLocalTranslation().getY() >= SINKING_HEIGHT) { // sink the ship, if it's not completely sunk
- spatial.move(0, tpf * 0.1f * -1, 0);
+ if(ship.isDestroyed()){
+ if(spatial.getLocalTranslation().getY() < SINKING_HEIGHT) { // removes the ship, if it is completely sunk
+ spatial.getParent().detachChild(spatial);
+ }
+ else // sink the ship, if it's not completely sunk
+ spatial.move(0, tpf * 0.1f * -1, 0);
+
}
+
+
// Update the time within the oscillation cycle
time = (time + tpf) % cycle;
diff --git a/Projekte/battleship/client/src/main/resources/Models/Destroyer/10619_Battleship.j3o b/Projekte/battleship/client/src/main/resources/Models/Destroyer/10619_Battleship.j3o
new file mode 100644
index 00000000..18da1ebb
Binary files /dev/null and b/Projekte/battleship/client/src/main/resources/Models/Destroyer/10619_Battleship.j3o differ
diff --git a/Projekte/battleship/client/src/main/resources/Models/SmallShip/10634_SpeedBoat_v01_LOD3.j3o b/Projekte/battleship/client/src/main/resources/Models/SmallShip/10634_SpeedBoat_v01_LOD3.j3o
new file mode 100644
index 00000000..9c2b6cd3
Binary files /dev/null and b/Projekte/battleship/client/src/main/resources/Models/SmallShip/10634_SpeedBoat_v01_LOD3.j3o differ
diff --git a/Projekte/battleship/client/src/main/resources/Models/Submarine/submarine.j3o b/Projekte/battleship/client/src/main/resources/Models/Submarine/submarine.j3o
new file mode 100644
index 00000000..928ebd9c
Binary files /dev/null and b/Projekte/battleship/client/src/main/resources/Models/Submarine/submarine.j3o differ
diff --git a/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java b/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java
index 819fc9db..4948469a 100644
--- a/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java
+++ b/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java
@@ -41,7 +41,7 @@ public static void main(String[] args) {
*/
@Override
public void simpleInitApp() {
- export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS
+ export("Models/KingGeorgeV/rocket/proton.obj", "proton.j3o"); //NON-NLS
stop();
}
diff --git a/Projekte/battleship/model/src/main/java/pp/battleship/model/Shell.java b/Projekte/battleship/model/src/main/java/pp/battleship/model/Shell.java
index 57a9c5dd..90656c3b 100644
--- a/Projekte/battleship/model/src/main/java/pp/battleship/model/Shell.java
+++ b/Projekte/battleship/model/src/main/java/pp/battleship/model/Shell.java
@@ -11,10 +11,9 @@ public class Shell implements Item {
private static final Logger LOGGER = System.getLogger(Shell.class.getName());
/**
- * the Target, the Shell will hit, displayed through: x,y
+ * the Target, the Shell will hit
*/
- private int x;
- private int y;
+ private IntPoint target;
/**
* the constructor for this class
@@ -22,8 +21,7 @@ public class Shell implements Item {
* @param target the target, the shell is fired at
*/
public Shell(IntPoint target) {
- this.x = target.getX();
- this.y = target.getY();
+ this.target = target;
LOGGER.log(Level.INFO, "Shell has been initialized");
}
@@ -49,14 +47,13 @@ public void accept(VoidVisitor visitor) {
visitor.visit(this);
}
-
/**
* getter for the x coordinate
*
* @return int x coordinate
*/
public int getX() {
- return x;
+ return target.getX();
}
/**
@@ -65,24 +62,6 @@ public int getX() {
* @return int y coordinate
*/
public int getY() {
- return y;
- }
-
- /**
- * setter for x coordinate
- *
- * @param x the new value of x coordinate
- */
- public void setX(int x) {
- this.x = x;
- }
-
- /**
- * setter for y coordinate
- *
- * @param y the new value of y coordinate
- */
- public void setY(int y) {
- this.y = y;
+ return target.getY();
}
}