@Test public void testMapAllVisit() { init(); Player player = new Player(); world.addEntity(player); world.gameLoop(1); assertEquals(World.getInstance().getTiles().getVisited(0, 0), false); MiniMap.visitChunk(); assertEquals(World.getInstance().getTiles().getVisited(0, 0), true); }
public static void visitChunk() { Player player = World.getInstance().getFirstPlayer(); int top = 0; int left = (int) Math.floor(player.getX()) - (Chunk.CHUNK_WIDTH / 2); int right = (int) Math.floor(player.getX()) + (Chunk.CHUNK_WIDTH / 2); int bottom = Chunk.CHUNK_HEIGHT; World world = World.getInstance(); WorldTiles tiles = world.getTiles(); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (!tiles.test(x,y)) { continue; } tiles.setVisited(x, y, true); } } }
MiniMap { public static void visitChunk() { Player player = World.getInstance().getFirstPlayer(); int top = 0; int left = (int) Math.floor(player.getX()) - (Chunk.CHUNK_WIDTH / 2); int right = (int) Math.floor(player.getX()) + (Chunk.CHUNK_WIDTH / 2); int bottom = Chunk.CHUNK_HEIGHT; World world = World.getInstance(); WorldTiles tiles = world.getTiles(); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (!tiles.test(x,y)) { continue; } tiles.setVisited(x, y, true); } } } }
MiniMap { public static void visitChunk() { Player player = World.getInstance().getFirstPlayer(); int top = 0; int left = (int) Math.floor(player.getX()) - (Chunk.CHUNK_WIDTH / 2); int right = (int) Math.floor(player.getX()) + (Chunk.CHUNK_WIDTH / 2); int bottom = Chunk.CHUNK_HEIGHT; World world = World.getInstance(); WorldTiles tiles = world.getTiles(); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (!tiles.test(x,y)) { continue; } tiles.setVisited(x, y, true); } } } private  MiniMap(); }
MiniMap { public static void visitChunk() { Player player = World.getInstance().getFirstPlayer(); int top = 0; int left = (int) Math.floor(player.getX()) - (Chunk.CHUNK_WIDTH / 2); int right = (int) Math.floor(player.getX()) + (Chunk.CHUNK_WIDTH / 2); int bottom = Chunk.CHUNK_HEIGHT; World world = World.getInstance(); WorldTiles tiles = world.getTiles(); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (!tiles.test(x,y)) { continue; } tiles.setVisited(x, y, true); } } } private  MiniMap(); static void toggleVisibility(); static void setVisibility(boolean visibility); static boolean getVisibility(); static List<Entity> getMapEntities(List<Entity> allEntities); static void visitChunk(); static void updateVisited(Player player); }
MiniMap { public static void visitChunk() { Player player = World.getInstance().getFirstPlayer(); int top = 0; int left = (int) Math.floor(player.getX()) - (Chunk.CHUNK_WIDTH / 2); int right = (int) Math.floor(player.getX()) + (Chunk.CHUNK_WIDTH / 2); int bottom = Chunk.CHUNK_HEIGHT; World world = World.getInstance(); WorldTiles tiles = world.getTiles(); for (int x = left; x < right; x++) { for (int y = top; y < bottom; y++) { if (!tiles.test(x,y)) { continue; } tiles.setVisited(x, y, true); } } } private  MiniMap(); static void toggleVisibility(); static void setVisibility(boolean visibility); static boolean getVisibility(); static List<Entity> getMapEntities(List<Entity> allEntities); static void visitChunk(); static void updateVisited(Player player); static final int MAP_PADDING; }