Search in sources :

Example 1 with Collidable

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

the class Selector method checkSelection.

/**
 * Check selection depending of area.
 *
 * @param componentCollision The component collision reference.
 * @param selection The current selection area.
 */
private void checkSelection(ComponentCollision componentCollision, Area selection) {
    for (final Collidable collidable : componentCollision.getInside(selection)) {
        if (collidable.hasFeature(Selectable.class)) {
            final Selectable selectable = collidable.getFeature(Selectable.class);
            if (filter.test(selected, selectable)) {
                selectable.onSelection(true);
                selected.add(selectable);
            }
        }
    }
}
Also used : Collidable(com.b3dgs.lionengine.game.feature.collidable.Collidable)

Aggregations

Collidable (com.b3dgs.lionengine.game.feature.collidable.Collidable)1