Skip to content

Commit

Permalink
Removed Controller from constructor of Basic manager
Browse files Browse the repository at this point in the history
  • Loading branch information
bagarozzi committed Jul 8, 2024
1 parent e59d578 commit e3003aa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Float, Float> playerSpawnPoint,
final List<GenPair<Float, Float>> enemiesSpawnpoint,
final boolean generateWalls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit e3003aa

Please sign in to comment.