use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel in project lionengine by b3dgs.
the class MapTileCollisionModelTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
map.addFeature(new MapTileGroupModel());
map.create(1, 1, 3, 3);
UtilMap.setGroups(map);
UtilMap.fill(map, UtilMap.TILE_GROUND);
mapCollision = map.addFeatureAndGet(new MapTileCollisionModel());
mapCollision.prepare(map);
formulasConfig = UtilConfig.createFormulaConfig(formulaV, formulaH);
groupsConfig = UtilConfig.createGroupsConfig(group);
mapCollision.loadCollisions(formulasConfig, groupsConfig);
transformable = createObject();
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel in project lionengine by b3dgs.
the class CollisionCategoryConfigTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTileGroupModel());
mapCollision = new MapTileCollisionModel();
mapCollision.prepare(map);
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel in project lionengine by b3dgs.
the class MapTilePathModelTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
services.add(new Camera());
map.addFeature(new MapTileGroupModel());
map.create(1, 1, 7, 7);
UtilMap.setGroups(map);
UtilMap.fill(map, UtilMap.TILE_GROUND);
mapPath = map.addFeatureAndGet(new MapTilePathModel());
mapPath.prepare(map);
mapPath.loadPathfinding(Medias.create("pathfinding.xml"));
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel in project lionengine by b3dgs.
the class AstarTest method testCreatePathFinder.
/**
* Test the create path finder.
*/
@Test
void testCreatePathFinder() {
final MapTileGame map = new MapTileGame();
map.addFeature(new MapTileGroupModel());
map.addFeature(new MapTilePathModel());
assertNotNull(Astar.createPathFinder(map, 1, new HeuristicClosest()));
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTileGroupModel in project lionengine by b3dgs.
the class TransitionsConfigTest method testExportsImports.
/**
* Test exports and imports.
*
* @throws IOException If error.
*/
@Test
void testExportsImports() throws IOException {
final MapTile map = UtilMap.createMap(7);
UtilMap.fill(map, UtilMap.TILE_WATER);
UtilMap.fill(map, UtilMap.TILE_WATER, UtilMap.TILE_TRANSITION, 3);
final MapTile map2 = UtilMap.createMap(7);
UtilMap.fill(map, UtilMap.TILE_WATER);
UtilMap.fill(map, UtilMap.TILE_GROUND, UtilMap.TILE_TRANSITION, 3);
final MapTileGame map3 = new MapTileGame();
map3.addFeature(new MapTileGroupModel());
map3.create(1, 1, 3, 3);
final TransitionsExtractor extractor = new TransitionsExtractorImpl();
final Map<Transition, Collection<Integer>> transitions = extractor.getTransitions(Arrays.asList(map, map2, map3));
final Media media = Medias.create("transition.xml");
TransitionsConfig.exports(media, transitions);
assertEquals(transitions, TransitionsConfig.imports(media));
assertTrue(media.getFile().delete());
}
Aggregations