diff --git a/cicaprojekt/Box.java b/cicaprojekt/Box.java index 85421cf..858d4ab 100644 --- a/cicaprojekt/Box.java +++ b/cicaprojekt/Box.java @@ -7,9 +7,11 @@ public class Box implements Pickable, Destroyable { public Box() { } + @Override public void destroy() { } + @Override public void pick() { } diff --git a/cicaprojekt/Field.java b/cicaprojekt/Field.java index 9c3ef7f..4c85364 100644 --- a/cicaprojekt/Field.java +++ b/cicaprojekt/Field.java @@ -10,6 +10,7 @@ public class Field extends cicaprojekt.Tile { return boxStack.isEmpty(); } + @Override public void onEntry(PlayerBase playerBase) { super.onEntry(playerBase); if (boxStack.size() > 0) @@ -19,5 +20,6 @@ public class Field extends cicaprojekt.Tile { playerBase.pickZPM(this); } + @Override public void onExit(PlayerBase playerBase) {} } diff --git a/cicaprojekt/Gap.java b/cicaprojekt/Gap.java index 6646ca1..9e3e4b2 100644 --- a/cicaprojekt/Gap.java +++ b/cicaprojekt/Gap.java @@ -11,11 +11,13 @@ public class Gap extends cicaprojekt.Tile { return true; } + @Override public void onEntry(PlayerBase playerBase) { super.onEntry(playerBase); playerBase.destroy(); } + @Override public void onExit(PlayerBase playerBase) throws IllegalStateException { throw new IllegalStateException("Hiba! A szakadékból nem jut ki semmi!"); } diff --git a/cicaprojekt/Gate.java b/cicaprojekt/Gate.java index 6eb4faa..2a56dc1 100644 --- a/cicaprojekt/Gate.java +++ b/cicaprojekt/Gate.java @@ -12,11 +12,13 @@ public class Gate extends Tile { if (this.open) adjacentTile.get(direction).spawnStargate(stargate, direction); } + @Override public void onEntry(PlayerBase playerBase) { super.onEntry(playerBase); if (open) playerBase.setCurrentTile(this); } + @Override public void onExit(PlayerBase playerBase) throws IllegalStateException { if (!open) { throw new IllegalStateException("Hiba! Te hogy kerültél a csukott ajtóba?"); diff --git a/cicaprojekt/PlayerBase.java b/cicaprojekt/PlayerBase.java index 0d1cd49..233e825 100644 --- a/cicaprojekt/PlayerBase.java +++ b/cicaprojekt/PlayerBase.java @@ -18,6 +18,7 @@ public class PlayerBase implements Destroyable { return String.format("%s: %s", name, currentTile); } + @Override public void destroy() { destroyed = true; Game.instance.playerBaseDestroyed(this); diff --git a/cicaprojekt/Wall.java b/cicaprojekt/Wall.java index 5469ee9..3a3be71 100644 --- a/cicaprojekt/Wall.java +++ b/cicaprojekt/Wall.java @@ -30,12 +30,14 @@ public class Wall extends Tile { } } + @Override public void onEntry(PlayerBase playerBase) { super.onEntry(playerBase); if (sg != null) sg.teleport(playerBase); } + @Override public void onExit(PlayerBase playerBase) throws IllegalStateException { if(sg != null) return; throw new IllegalStateException("Hiba! Te hogy kerültél a falba?"); diff --git a/cicaprojekt/ZPM.java b/cicaprojekt/ZPM.java index 6c39faf..f1af8a9 100644 --- a/cicaprojekt/ZPM.java +++ b/cicaprojekt/ZPM.java @@ -1,6 +1,7 @@ package cicaprojekt; public class ZPM implements Pickable { + @Override public void pick() { }