From e3003aa2589fb1e23915af95bcb0c3d8b6732744 Mon Sep 17 00:00:00 2001 From: Federico Bagattoni Date: Mon, 8 Jul 2024 23:19:32 +0200 Subject: [PATCH] Removed Controller from constructor of Basic manager --- .../bombardero/core/impl/BasicBombarderoGameManager.java | 1 - .../it/unibo/bombardero/core/impl/BombarderoController.java | 4 ++-- .../bombardero/core/impl/FullBombarderoGameManager.java | 4 ++-- .../unibo/bombardero/guide/impl/BombarderoGuideManager.java | 4 ++-- .../java/it/unibo/bombardero/view/BombarderoGraphics.java | 6 +++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/it/unibo/bombardero/core/impl/BasicBombarderoGameManager.java b/src/main/java/it/unibo/bombardero/core/impl/BasicBombarderoGameManager.java index 278e837e..84f4962f 100644 --- a/src/main/java/it/unibo/bombardero/core/impl/BasicBombarderoGameManager.java +++ b/src/main/java/it/unibo/bombardero/core/impl/BasicBombarderoGameManager.java @@ -55,7 +55,6 @@ public class BasicBombarderoGameManager implements GameManager { * @param cEngine the collision engine linked to this instance of the game. */ public BasicBombarderoGameManager( - final Controller controller, final GenPair playerSpawnPoint, final List> enemiesSpawnpoint, final boolean generateWalls, diff --git a/src/main/java/it/unibo/bombardero/core/impl/BombarderoController.java b/src/main/java/it/unibo/bombardero/core/impl/BombarderoController.java index fe2a3a07..63569ebb 100644 --- a/src/main/java/it/unibo/bombardero/core/impl/BombarderoController.java +++ b/src/main/java/it/unibo/bombardero/core/impl/BombarderoController.java @@ -47,7 +47,7 @@ public BombarderoController() { @Override public void startGame() { - this.manager = new FullBombarderoGameManager(this, new BombarderoCollision(new CollisionHandlerImpl())); + this.manager = new FullBombarderoGameManager(new BombarderoCollision(new CollisionHandlerImpl())); isGamePaused = false; isGameStarted = true; graphics.showGameScreen(GraphicsEngine.ViewCards.GAME); @@ -64,7 +64,7 @@ public void endGame() { @Override public void startGuide() { - this.manager = new BombarderoGuideManager(this, new BombarderoCollision(new CollisionHandlerImpl())); + this.manager = new BombarderoGuideManager(new BombarderoCollision(new CollisionHandlerImpl())); isGamePaused = false; isGameStarted = true; graphics.showGameScreen(GraphicsEngine.ViewCards.GUIDE); diff --git a/src/main/java/it/unibo/bombardero/core/impl/FullBombarderoGameManager.java b/src/main/java/it/unibo/bombardero/core/impl/FullBombarderoGameManager.java index 0a485f9a..28e9fcd6 100644 --- a/src/main/java/it/unibo/bombardero/core/impl/FullBombarderoGameManager.java +++ b/src/main/java/it/unibo/bombardero/core/impl/FullBombarderoGameManager.java @@ -20,8 +20,8 @@ public final class FullBombarderoGameManager extends BasicBombarderoGameManager * @param controller the game's controller * @param cEngine the collision engine related to this instance of the game. */ - public FullBombarderoGameManager(final Controller controller, final CollisionEngine cEngine) { - super(controller, Utils.PLAYER_SPAWNPOINT, + public FullBombarderoGameManager(final CollisionEngine cEngine) { + super(Utils.PLAYER_SPAWNPOINT, Utils.ENEMIES_SPAWNPOINT.subList(0, 1), true, cEngine); diff --git a/src/main/java/it/unibo/bombardero/guide/impl/BombarderoGuideManager.java b/src/main/java/it/unibo/bombardero/guide/impl/BombarderoGuideManager.java index 1f96af9a..7073635e 100644 --- a/src/main/java/it/unibo/bombardero/guide/impl/BombarderoGuideManager.java +++ b/src/main/java/it/unibo/bombardero/guide/impl/BombarderoGuideManager.java @@ -39,8 +39,8 @@ public final class BombarderoGuideManager extends BasicBombarderoGameManager imp * @param controller the reference to the game's {@link Controller}. * @param cEngine the collision engine related to this instance of the game. */ - public BombarderoGuideManager(final Controller controller, final CollisionEngine cEngine) { - super(controller, GuideManager.PLAYER_GUIDE_SPAWNPOINT, List.of(), false, cEngine); + public BombarderoGuideManager(final CollisionEngine cEngine) { + super(GuideManager.PLAYER_GUIDE_SPAWNPOINT, List.of(), false, cEngine); this.getGameMap().addBreakableWall(CRATE_GUIDE_SPAWNPOINT); initialiseProcedures(); } diff --git a/src/main/java/it/unibo/bombardero/view/BombarderoGraphics.java b/src/main/java/it/unibo/bombardero/view/BombarderoGraphics.java index 9cb8c304..0593da7c 100644 --- a/src/main/java/it/unibo/bombardero/view/BombarderoGraphics.java +++ b/src/main/java/it/unibo/bombardero/view/BombarderoGraphics.java @@ -55,9 +55,9 @@ public BombarderoGraphics(final Controller controller) { frame.setLocationRelativeTo(null); frame.setIconImage(gameIconImage.getScaledInstance(64, 64, Image.SCALE_SMOOTH)); - MenuCard menuCard = new MenuCard(controller, this, resourceGetter); - GamePlayCard guideCard = new GuideCard(controller, this, Map.of(), List.of(), List.of()); - GamePlayCard gameCard = new GameCard(controller, this); + final MenuCard menuCard = new MenuCard(controller, this, resourceGetter); + final GamePlayCard guideCard = new GuideCard(controller, this, Map.of(), List.of(), List.of()); + final GamePlayCard gameCard = new GameCard(controller, this); deck.add(ViewCards.GUIDE.getStringId(), guideCard); layout.addLayoutComponent(guideCard, ViewCards.GUIDE.getStringId());