Search in sources :

Example 41 with Setup

use of com.b3dgs.lionengine.game.feature.Setup in project lionengine by b3dgs.

the class StateConfigTest method testExportsImports.

/**
 * Test exports imports.
 */
@Test
void testExportsImports() {
    final Xml root = new Xml("test");
    root.add(StateConfig.exports(Class.class));
    final Media media = Medias.create("state.xml");
    root.save(media);
    assertEquals(Class.class.getName(), StateConfig.imports(new Setup(media)).get());
    assertTrue(media.getFile().delete());
}
Also used : Xml(com.b3dgs.lionengine.Xml) Media(com.b3dgs.lionengine.Media) Setup(com.b3dgs.lionengine.game.feature.Setup) Test(org.junit.jupiter.api.Test)

Example 42 with Setup

use of com.b3dgs.lionengine.game.feature.Setup in project lionengine by b3dgs.

the class MapTileCollisionModelTest method createObject.

/**
 * Create object test.
 *
 * @return The object test.
 */
private Transformable createObject() {
    final Setup setup = new Setup(config);
    CollisionCategoryConfig.exports(setup.getRoot(), categoryY);
    CollisionCategoryConfig.exports(setup.getRoot(), categoryX);
    final FeaturableModel object = new FeaturableModel(services, setup);
    final Transformable transformable = object.addFeatureAndGet(new TransformableModel(services, setup));
    transformable.setSize(1, 1);
    final TileCollidable collidable = object.addFeatureAndGet(new TileCollidableModel(services, setup));
    collidable.setEnabled(true);
    return transformable;
}
Also used : TransformableModel(com.b3dgs.lionengine.game.feature.TransformableModel) Transformable(com.b3dgs.lionengine.game.feature.Transformable) FeaturableModel(com.b3dgs.lionengine.game.feature.FeaturableModel) Setup(com.b3dgs.lionengine.game.feature.Setup) UtilSetup(com.b3dgs.lionengine.game.feature.UtilSetup)

Aggregations

Setup (com.b3dgs.lionengine.game.feature.Setup)42 Test (org.junit.jupiter.api.Test)34 Media (com.b3dgs.lionengine.Media)31 UtilSetup (com.b3dgs.lionengine.game.feature.UtilSetup)20 FeaturableModel (com.b3dgs.lionengine.game.feature.FeaturableModel)18 TransformableModel (com.b3dgs.lionengine.game.feature.TransformableModel)15 Xml (com.b3dgs.lionengine.Xml)11 Featurable (com.b3dgs.lionengine.game.feature.Featurable)11 Transformable (com.b3dgs.lionengine.game.feature.Transformable)11 Services (com.b3dgs.lionengine.game.feature.Services)10 Medias (com.b3dgs.lionengine.Medias)6 UtilAssert.assertEquals (com.b3dgs.lionengine.UtilAssert.assertEquals)6 UtilAssert.assertTrue (com.b3dgs.lionengine.UtilAssert.assertTrue)6 Identifiable (com.b3dgs.lionengine.game.feature.Identifiable)6 Handler (com.b3dgs.lionengine.game.feature.Handler)5 AtomicReference (java.util.concurrent.atomic.AtomicReference)5 AfterAll (org.junit.jupiter.api.AfterAll)5 BeforeAll (org.junit.jupiter.api.BeforeAll)5 BeforeEach (org.junit.jupiter.api.BeforeEach)5 UtilAssert.assertFalse (com.b3dgs.lionengine.UtilAssert.assertFalse)4