diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index 36f8f5d..5c9067c 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -79,11 +79,11 @@ public class GameManager { } public void spawnFruit() { - map.GetCell(map.playerSpawn).type = randomFruit(); + map.getCell(map.playerSpawn).type = randomFruit(); } public void destroyFruit() { - map.GetCell(map.playerSpawn).type = "empty"; + map.getCell(map.playerSpawn).type = "empty"; } public String randomFruit() { @@ -128,7 +128,7 @@ public class GameManager { } public void updatePlayerCell() { - map.GetCell(player.position).triggerItem(); + map.getCell(player.position).triggerItem(); } public void makeGhostEdible(int timeStopPillEffect) { diff --git a/src/main/java/pacmanGame/Map.java b/src/main/java/pacmanGame/Map.java index 31223d7..8412837 100644 --- a/src/main/java/pacmanGame/Map.java +++ b/src/main/java/pacmanGame/Map.java @@ -111,7 +111,7 @@ public class Map { } - public Cell GetCell(Vector2 pos) { + public Cell getCell(Vector2 pos) { if (pos.isWithin(size)) { return cells[pos.x][pos.y]; @@ -141,7 +141,7 @@ public class Map { for(int x = 0; x < size.x; x++) { for(int y = 0; y < size.y; y++) { Vector2 pos = new Vector2(x,y); - Cell cell = GetCell(pos); + Cell cell = getCell(pos); if(cell.type.equals("wall")) { tempMap[x][y] = 'w'; } diff --git a/src/main/java/pacmanGame/Player.java b/src/main/java/pacmanGame/Player.java index c622521..f84993c 100644 --- a/src/main/java/pacmanGame/Player.java +++ b/src/main/java/pacmanGame/Player.java @@ -19,7 +19,7 @@ public class Player { public void Move() { Vector2 newPosition = position.Add(direction); - boolean newPosIsWall = gameManager.map.GetCell(newPosition).type.equals("wall"); + boolean newPosIsWall = gameManager.map.getCell(newPosition).type.equals("wall"); if(!newPosIsWall) { position = newPosition; @@ -56,7 +56,7 @@ public class Player { public void checkInput(Vector2 input) { Vector2 newPosition = position.Add(input); - boolean newPosIsWall = gameManager.map.GetCell(newPosition).type.equals("wall"); + boolean newPosIsWall = gameManager.map.getCell(newPosition).type.equals("wall"); if(!newPosIsWall) { direction = input; savedDirection = null; diff --git a/src/main/java/pacmanGame/VisualizerPlainText.java b/src/main/java/pacmanGame/VisualizerPlainText.java index c4d84e2..61b883f 100644 --- a/src/main/java/pacmanGame/VisualizerPlainText.java +++ b/src/main/java/pacmanGame/VisualizerPlainText.java @@ -54,7 +54,7 @@ public class VisualizerPlainText implements Visualizer { for(int y = 0; y < map.size.y; y++) { for(int x = 0; x < map.size.x; x++) { - Cell cell = map.GetCell(new Vector2(x, map.size.y - 1 - y)); + Cell cell = map.getCell(new Vector2(x, map.size.y - 1 - y)); if(gameManager.isPaused && 5 < y && y <= 10){ diff --git a/src/main/java/pacmanGame/VisualizerPlainTextUltra.java b/src/main/java/pacmanGame/VisualizerPlainTextUltra.java index 2dce9c1..729a96f 100644 --- a/src/main/java/pacmanGame/VisualizerPlainTextUltra.java +++ b/src/main/java/pacmanGame/VisualizerPlainTextUltra.java @@ -168,7 +168,7 @@ public class VisualizerPlainTextUltra implements Visualizer { } for(int x = 0; x < map.size.x; x++) { - Cell cell = map.GetCell(new Vector2(x, map.size.y - 1 - y)); + Cell cell = map.getCell(new Vector2(x, map.size.y - 1 - y)); boolean containsGhosts = false; boolean containsPlayer = false; diff --git a/src/test/java/pacmanTests/CellTest.java b/src/test/java/pacmanTests/CellTest.java index 4d58241..98c26e1 100644 --- a/src/test/java/pacmanTests/CellTest.java +++ b/src/test/java/pacmanTests/CellTest.java @@ -14,7 +14,7 @@ class CellTest { void cell_triggerItem_505cherryScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "cherry"; int expectedScore = 505; // act @@ -28,7 +28,7 @@ class CellTest { void cell_triggerItem_10dotScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "dot"; int expectedScore = 10; // act @@ -42,7 +42,7 @@ class CellTest { void cell_triggerItem_100pillScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "pill"; int expectedScore = 100; // act @@ -56,7 +56,7 @@ class CellTest { void cell_triggerItem_405strawberryScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "strawberry"; int expectedScore = 405; // act @@ -70,7 +70,7 @@ class CellTest { void cell_triggerItem_305orangeScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "orange"; int expectedScore = 305; // act @@ -84,7 +84,7 @@ class CellTest { void cell_triggerItem_205appleScore() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "apple"; int expectedScore = 205; // act @@ -98,7 +98,7 @@ class CellTest { void cell_triggerItem_3crystalMoveSpeed() { // arrange GameManager gameManager = new GameManager(); - Cell cell = gameManager.map.GetCell(new Vector2(0,0)); + Cell cell = gameManager.map.getCell(new Vector2(0,0)); cell.type = "crystal"; int expectedMoveSpeed = 3; // act diff --git a/src/test/java/pacmanTests/MapTest.java b/src/test/java/pacmanTests/MapTest.java index 5b12899..7b479f1 100644 --- a/src/test/java/pacmanTests/MapTest.java +++ b/src/test/java/pacmanTests/MapTest.java @@ -49,9 +49,9 @@ class MapTest { Cell expectedMiddle = testMap.cells[1][1]; Cell expectedBottomRight = testMap.cells[2][0]; // act - Cell topLeft = testMap.GetCell(new Vector2(0, 2)); - Cell middle = testMap.GetCell(new Vector2(1, 1)); - Cell bottomRight = testMap.GetCell(new Vector2(2, 0)); + Cell topLeft = testMap.getCell(new Vector2(0, 2)); + Cell middle = testMap.getCell(new Vector2(1, 1)); + Cell bottomRight = testMap.getCell(new Vector2(2, 0)); // assert assertThat(expectedTopLeft).isEqualTo(topLeft); assertThat(expectedMiddle).isEqualTo(middle);