|
@ -13,6 +13,8 @@ public class VisualizerPlainText implements Visualizer { |
|
|
this.put("wall", "[]"); |
|
|
this.put("wall", "[]"); |
|
|
}}; |
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
public final String ghostSprite = "AA"; |
|
|
|
|
|
|
|
|
public VisualizerPlainText(GameManager gameManager) { |
|
|
public VisualizerPlainText(GameManager gameManager) { |
|
|
this.gameManager = gameManager; |
|
|
this.gameManager = gameManager; |
|
|
} |
|
|
} |
|
@ -30,8 +32,17 @@ public class VisualizerPlainText implements Visualizer { |
|
|
for(int y = 0; y < map.size.y; y++) { |
|
|
for(int y = 0; y < map.size.y; y++) { |
|
|
for(int x = 0; x < map.size.x; x++) { |
|
|
for(int x = 0; x < map.size.x; x++) { |
|
|
Cell cell = map.GetCell(new Vector2(x,y)); |
|
|
Cell cell = map.GetCell(new Vector2(x,y)); |
|
|
|
|
|
boolean containsGhosts = false; |
|
|
|
|
|
for( int i = 0; i < gameManager.ghosts.length; i++) { |
|
|
|
|
|
if(gameManager.ghosts[i].position.equals(cell.pos)) { |
|
|
|
|
|
containsGhosts = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (sprites.containsKey(cell.type)) { |
|
|
|
|
|
|
|
|
if(containsGhosts) { |
|
|
|
|
|
output += ghostSprite; |
|
|
|
|
|
} |
|
|
|
|
|
else if (sprites.containsKey(cell.type)) { |
|
|
|
|
|
|
|
|
output += sprites.get(cell.type); |
|
|
output += sprites.get(cell.type); |
|
|
} |
|
|
} |
|
@ -43,4 +54,6 @@ public class VisualizerPlainText implements Visualizer { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |