Search in sources :

Example 6 with Cursor

use of com.b3dgs.lionengine.game.Cursor in project lionengine by b3dgs.

the class HudTest method before.

/**
 * Prepare test.
 */
@BeforeEach
public void before() {
    services.add(new ContextMock());
    services.add(new Handler(services));
    services.add(new Factory(services));
    services.add(new ViewerMock());
    services.add(new Cursor(services));
    services.add(new ComponentCollision());
}
Also used : ViewerMock(com.b3dgs.lionengine.ViewerMock) Handler(com.b3dgs.lionengine.game.feature.Handler) Factory(com.b3dgs.lionengine.game.feature.Factory) ComponentCollision(com.b3dgs.lionengine.game.feature.collidable.ComponentCollision) ContextMock(com.b3dgs.lionengine.ContextMock) Cursor(com.b3dgs.lionengine.game.Cursor) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with Cursor

use of com.b3dgs.lionengine.game.Cursor in project lionengine by b3dgs.

the class UtilActionnable method createServices.

/**
 * Create the services.
 *
 * @param clicked The click flag.
 * @param clickNumber The click number recorded.
 * @return The services.
 */
public static Services createServices(AtomicBoolean clicked, AtomicReference<Integer> clickNumber) {
    final Services services = new Services();
    services.add(new ContextMock());
    final Cursor cursor = new Cursor(services) {

        @Override
        public boolean isPushedOnce(Integer click) {
            clickNumber.set(click);
            return clicked.get();
        }
    };
    cursor.setArea(0, 0, 32, 32);
    cursor.setLocation(0, 1);
    services.add(cursor);
    return services;
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) ContextMock(com.b3dgs.lionengine.ContextMock) Cursor(com.b3dgs.lionengine.game.Cursor)

Aggregations

Cursor (com.b3dgs.lionengine.game.Cursor)7 ContextMock (com.b3dgs.lionengine.ContextMock)5 Services (com.b3dgs.lionengine.game.feature.Services)4 Camera (com.b3dgs.lionengine.game.feature.Camera)3 ViewerMock (com.b3dgs.lionengine.ViewerMock)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Localizable (com.b3dgs.lionengine.Localizable)1 Factory (com.b3dgs.lionengine.game.feature.Factory)1 Featurable (com.b3dgs.lionengine.game.feature.Featurable)1 FeaturableModel (com.b3dgs.lionengine.game.feature.FeaturableModel)1 Handler (com.b3dgs.lionengine.game.feature.Handler)1 LayerableModel (com.b3dgs.lionengine.game.feature.LayerableModel)1 TransformableModel (com.b3dgs.lionengine.game.feature.TransformableModel)1 CollidableModel (com.b3dgs.lionengine.game.feature.collidable.CollidableModel)1 ComponentCollision (com.b3dgs.lionengine.game.feature.collidable.ComponentCollision)1 SelectorRefresher (com.b3dgs.lionengine.game.feature.collidable.selector.SelectorRefresher)1 Test (org.junit.jupiter.api.Test)1