@Test public void testLoadMaps() { final WorldMap[] maps = dao.retrieveAll(); final WorldMap map = maps[0]; assertTrue(map.getTile(0, 0).isBlocked()); assertFalse(map.getTile(83, 28).isBlocked()); assertNull(map.getTile(49, 49).getTileExit()); final Position tileExit = map.getTile(19, 84).getTileExit(); assertTrue(tileExit != null); assertTrue(tileExit.getX() >= WorldMap.MIN_X); assertTrue(tileExit.getX() <= WorldMap.MAX_X); assertTrue(tileExit.getY() >= WorldMap.MIN_Y); assertTrue(tileExit.getY() <= WorldMap.MAX_Y); assertEquals(map.getTile(0, 0).getTrigger(), Trigger.NONE); assertEquals(map.getTile(23, 32).getTrigger(), Trigger.UNDER_ROOF); assertEquals(map.getTile(57, 44).getTrigger(), Trigger.INVALID_POSITION); assertEquals(map.getTile(40, 74).getTrigger(), Trigger.SAFE_ZONE); assertEquals(map.getTile(28, 20).getTrigger(), Trigger.ANTI_PICKET); assertEquals(map.getTile(23, 33).getTrigger(), Trigger.FIGHT_ZONE); assertTrue(map.getTile(71, 55).isLava()); assertFalse(map.getTile(71, 55).isWater()); assertFalse(map.getTile(76, 72).isLava()); assertTrue(map.getTile(76, 72).isWater()); }
@Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; }
WorldMapDAOImpl implements WorldMapDAO { @Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; } }
WorldMapDAOImpl implements WorldMapDAO { @Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; } @Inject  WorldMapDAOImpl(@Named("mapsPath") final String mapsPath,
			@Named("mapsAmount") final int mapsAmount,
			@Named("mapsConfigFile") final String mapsConfigFile); }
WorldMapDAOImpl implements WorldMapDAO { @Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; } @Inject  WorldMapDAOImpl(@Named("mapsPath") final String mapsPath,
			@Named("mapsAmount") final int mapsAmount,
			@Named("mapsConfigFile") final String mapsConfigFile); @Override WorldMap[] retrieveAll(); }
WorldMapDAOImpl implements WorldMapDAO { @Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; } @Inject  WorldMapDAOImpl(@Named("mapsPath") final String mapsPath,
			@Named("mapsAmount") final int mapsAmount,
			@Named("mapsConfigFile") final String mapsConfigFile); @Override WorldMap[] retrieveAll();  }