Search in sources :

Example 1 with CollidableModel

use of com.b3dgs.lionengine.game.feature.collidable.CollidableModel in project lionengine by b3dgs.

the class CollidableFramedModelTest method createFeaturable.

/**
 * Create a featurable test.
 *
 * @param config The configuration reference.
 * @param services The services reference.
 * @return The featurable test.
 */
public static FeaturableModel createFeaturable(Media config, Services services) {
    final Setup setup = new Setup(config);
    final FeaturableModel featurable = new FeaturableModel(services, setup);
    final Transformable transformable = featurable.addFeatureAndGet(new TransformableModel(services, setup));
    transformable.setLocation(1.0, 2.0);
    featurable.addFeature(new AnimatableModel(services, setup));
    featurable.addFeatureAndGet(new CollidableModel(services, setup));
    featurable.addFeature(new CollidableFramedModel(services, setup));
    return featurable;
}
Also used : CollidableModel(com.b3dgs.lionengine.game.feature.collidable.CollidableModel) AnimatableModel(com.b3dgs.lionengine.game.feature.AnimatableModel) 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)

Example 2 with CollidableModel

use of com.b3dgs.lionengine.game.feature.collidable.CollidableModel in project lionengine by b3dgs.

the class SelectorRefresherTest method prepare.

/**
 * Prepare test.
 */
@BeforeEach
public void prepare() {
    services.add(new ContextMock());
    services.add(new Camera());
    services.add(new ViewerMock());
    cursor = services.create(Cursor.class);
    cursor.setSync(mouse);
    final Featurable featurable = new FeaturableModel(services, setup);
    featurable.addFeature(new LayerableModel(services, setup));
    featurable.addFeature(new TransformableModel(services, setup));
    featurable.addFeature(new CollidableModel(services, setup));
    refresher = new SelectorRefresher(services, model);
    refresher.addListener(listener);
    refresher.prepare(featurable);
}
Also used : CollidableModel(com.b3dgs.lionengine.game.feature.collidable.CollidableModel) ViewerMock(com.b3dgs.lionengine.ViewerMock) TransformableModel(com.b3dgs.lionengine.game.feature.TransformableModel) FeaturableModel(com.b3dgs.lionengine.game.feature.FeaturableModel) Camera(com.b3dgs.lionengine.game.feature.Camera) ContextMock(com.b3dgs.lionengine.ContextMock) Cursor(com.b3dgs.lionengine.game.Cursor) Featurable(com.b3dgs.lionengine.game.feature.Featurable) SelectorRefresher(com.b3dgs.lionengine.game.feature.collidable.selector.SelectorRefresher) LayerableModel(com.b3dgs.lionengine.game.feature.LayerableModel) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

FeaturableModel (com.b3dgs.lionengine.game.feature.FeaturableModel)2 TransformableModel (com.b3dgs.lionengine.game.feature.TransformableModel)2 CollidableModel (com.b3dgs.lionengine.game.feature.collidable.CollidableModel)2 ContextMock (com.b3dgs.lionengine.ContextMock)1 ViewerMock (com.b3dgs.lionengine.ViewerMock)1 Cursor (com.b3dgs.lionengine.game.Cursor)1 AnimatableModel (com.b3dgs.lionengine.game.feature.AnimatableModel)1 Camera (com.b3dgs.lionengine.game.feature.Camera)1 Featurable (com.b3dgs.lionengine.game.feature.Featurable)1 LayerableModel (com.b3dgs.lionengine.game.feature.LayerableModel)1 Setup (com.b3dgs.lionengine.game.feature.Setup)1 Transformable (com.b3dgs.lionengine.game.feature.Transformable)1 UtilSetup (com.b3dgs.lionengine.game.feature.UtilSetup)1 SelectorRefresher (com.b3dgs.lionengine.game.feature.collidable.selector.SelectorRefresher)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1