use of com.b3dgs.lionengine.game.feature.tile.TileGame in project lionengine by b3dgs.
the class MapTileGameTest method testAppendCreatedDifferentTileHeight.
/**
* Test the map append when map is created with different tile height.
*/
@Test(expected = LionEngineException.class)
public void testAppendCreatedDifferentTileHeight() {
map.create(1, 2, 1, 1);
final MapTile map1 = new MapTileGame();
map1.create(1, 1, 1, 1);
map1.setTile(new TileGame(Integer.valueOf(0), 0, 0, 0, 1, 1));
map.append(map1, 0, 0);
}
use of com.b3dgs.lionengine.game.feature.tile.TileGame in project lionengine by b3dgs.
the class MapTileGameTest method testAppendNotCreated.
/**
* Test the map append when map is not created.
*/
@Test
public void testAppendNotCreated() {
final MapTile map1 = new MapTileGame();
map1.create(1, 1, 1, 1);
map1.setTile(new TileGame(Integer.valueOf(0), 0, 0, 0, 1, 1));
Assert.assertEquals(0, map.getInTileWidth());
Assert.assertEquals(0, map.getInTileHeight());
Assert.assertEquals(0, map.getTilesNumber());
map.append(map1, 0, 0);
Assert.assertEquals(1, map.getInTileWidth());
Assert.assertEquals(1, map.getInTileHeight());
Assert.assertEquals(1, map.getTilesNumber());
}
use of com.b3dgs.lionengine.game.feature.tile.TileGame in project lionengine by b3dgs.
the class MapTileGameTest method testAppendCreatedSameTileSize.
/**
* Test the map append when map is created with same tile size.
*/
@Test
public void testAppendCreatedSameTileSize() {
map.create(1, 1, 1, 1);
final MapTile map1 = new MapTileGame();
map1.create(1, 1, 1, 1);
map1.setTile(new TileGame(Integer.valueOf(0), 0, 0, 0, 1, 1));
Assert.assertEquals(1, map.getInTileWidth());
Assert.assertEquals(1, map.getInTileHeight());
Assert.assertEquals(0, map.getTilesNumber());
map.append(map1, 0, 0);
Assert.assertEquals(1, map.getInTileWidth());
Assert.assertEquals(1, map.getInTileHeight());
Assert.assertEquals(1, map.getTilesNumber());
}
use of com.b3dgs.lionengine.game.feature.tile.TileGame in project lionengine by b3dgs.
the class MapTileGameTest method testAppendCollectionCreated.
/**
* Test the map collection append when map is created.
*/
@Test
public void testAppendCollectionCreated() {
map.create(1, 1, 1, 1);
final MapTile map1 = new MapTileGame();
map1.create(1, 1, 2, 2);
map1.setTile(new TileGame(Integer.valueOf(0), 0, 0, 0, 1, 1));
Assert.assertEquals(1, map.getInTileWidth());
Assert.assertEquals(1, map.getInTileHeight());
Assert.assertEquals(0, map.getTilesNumber());
map.append(Arrays.asList(map1, map1), 0, 0, 0, 0);
Assert.assertEquals(5, map.getInTileWidth());
Assert.assertEquals(5, map.getInTileHeight());
Assert.assertEquals(1, map.getTilesNumber());
}
use of com.b3dgs.lionengine.game.feature.tile.TileGame in project lionengine by b3dgs.
the class MapTileGameTest method testAppendCreatedDifferentTileWidth.
/**
* Test the map append when map is created with different tile width.
*/
@Test(expected = LionEngineException.class)
public void testAppendCreatedDifferentTileWidth() {
map.create(2, 1, 1, 1);
final MapTile map1 = new MapTileGame();
map1.create(1, 1, 1, 1);
map1.setTile(new TileGame(Integer.valueOf(0), 0, 0, 0, 1, 1));
map.append(map1, 0, 0);
}
Aggregations