@Test public void testMapEntities() { init(); Chunk chunk = TestHelper.getFlatChunk(BiomeType.ROCK, TileInfo.get(Tiles.ROCK)); world.setDecoGenEnabled(true); chunk.setDecorationSpawnChance(1); chunk.generateDecorations(); Player player = new Player(); world.addEntity(player); TestingNPC npc1 = new TestingNPC(); TestingNPC npc2 = new TestingNPC(); world.addEntity(npc1); world.addEntity(npc2); world.gameLoop(1); int mapEntities = MiniMap.getMapEntities(world.getAllEntities()).size(); assertEquals(mapEntities, 3); }
public static List<Entity> getMapEntities(List<Entity> allEntities) { List<Entity> entities = new ArrayList<>(); for (Entity entity : allEntities) { if(entity instanceof BaseNPC || entity instanceof ItemEntity || entity instanceof Player) { entities.add(entity); } } return entities; }
MiniMap { public static List<Entity> getMapEntities(List<Entity> allEntities) { List<Entity> entities = new ArrayList<>(); for (Entity entity : allEntities) { if(entity instanceof BaseNPC || entity instanceof ItemEntity || entity instanceof Player) { entities.add(entity); } } return entities; } }
MiniMap { public static List<Entity> getMapEntities(List<Entity> allEntities) { List<Entity> entities = new ArrayList<>(); for (Entity entity : allEntities) { if(entity instanceof BaseNPC || entity instanceof ItemEntity || entity instanceof Player) { entities.add(entity); } } return entities; } private  MiniMap(); }
MiniMap { public static List<Entity> getMapEntities(List<Entity> allEntities) { List<Entity> entities = new ArrayList<>(); for (Entity entity : allEntities) { if(entity instanceof BaseNPC || entity instanceof ItemEntity || entity instanceof Player) { entities.add(entity); } } return entities; } 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 List<Entity> getMapEntities(List<Entity> allEntities) { List<Entity> entities = new ArrayList<>(); for (Entity entity : allEntities) { if(entity instanceof BaseNPC || entity instanceof ItemEntity || entity instanceof Player) { entities.add(entity); } } return entities; } 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; }