Search in sources :

Example 11 with TileGame

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);
}
Also used : TileGame(com.b3dgs.lionengine.game.feature.tile.TileGame) Test(org.junit.Test)

Example 12 with TileGame

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());
}
Also used : TileGame(com.b3dgs.lionengine.game.feature.tile.TileGame) Test(org.junit.Test)

Example 13 with TileGame

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());
}
Also used : TileGame(com.b3dgs.lionengine.game.feature.tile.TileGame) Test(org.junit.Test)

Example 14 with TileGame

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());
}
Also used : TileGame(com.b3dgs.lionengine.game.feature.tile.TileGame) Test(org.junit.Test)

Example 15 with TileGame

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);
}
Also used : TileGame(com.b3dgs.lionengine.game.feature.tile.TileGame) Test(org.junit.Test)

Aggregations

TileGame (com.b3dgs.lionengine.game.feature.tile.TileGame)18 Tile (com.b3dgs.lionengine.game.feature.tile.Tile)8 Test (org.junit.Test)8 MapTile (com.b3dgs.lionengine.game.feature.tile.map.MapTile)3 MapTileGame (com.b3dgs.lionengine.game.feature.tile.map.MapTileGame)3 MapTileTransition (com.b3dgs.lionengine.game.feature.tile.map.transition.MapTileTransition)2 Test (org.junit.jupiter.api.Test)2 GroupTransition (com.b3dgs.lionengine.game.feature.tile.map.transition.GroupTransition)1 Transition (com.b3dgs.lionengine.game.feature.tile.map.transition.Transition)1