From 8823cd5128d06af482d1d37c05c3c7ca74f2445f Mon Sep 17 00:00:00 2001 From: fdai7910 Date: Sat, 3 Feb 2024 20:06:15 +0100 Subject: [PATCH] refactoring: removed one constructor in Map --- src/main/java/pacmanGame/GameManager.java | 2 +- src/main/java/pacmanGame/Map.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index d269424..2d5ae52 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -13,7 +13,7 @@ public class GameManager { } public void setupGame(){ - map = new Map(); + map = new Map(Map.mapClassic); visualizer = new VisualizerPlainText(this); player = new Player(this); player.Spawn(); diff --git a/src/main/java/pacmanGame/Map.java b/src/main/java/pacmanGame/Map.java index 8e9371f..7f5e7d4 100644 --- a/src/main/java/pacmanGame/Map.java +++ b/src/main/java/pacmanGame/Map.java @@ -3,7 +3,8 @@ package pacmanGame; import java.util.HashMap; public class Map { - public final String[] mapClassic = { + + public static String[] mapClassic = { "wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", "wwwwwwwwwwwwwwwwwwwwwwwwwwwwww", "ww............ww............ww", @@ -52,10 +53,6 @@ public class Map { public Vector2 playerSpawn = new Vector2(2,2); public char playerSpawnChar = 's'; - public Map() { - GenerateMap(mapClassic); - } - public Map(String[] mapData) { GenerateMap(mapData); }