use of com.b3dgs.lionengine.game.feature.ActionableModel in project lionengine by b3dgs.
the class UtilActionnable method createActionable.
/**
* Create the actionable.
*
* @param media The media.
* @param services The services.
* @return The prepared actionable.
*/
public static ActionableModel createActionable(Media media, Services services) {
final Setup setup = new Setup(media);
final Featurable featurable = new FeaturableModel(services, setup);
final ActionableModel actionable = new ActionableModel(services, setup);
actionable.prepare(featurable);
return actionable;
}
use of com.b3dgs.lionengine.game.feature.ActionableModel in project lionengine by b3dgs.
the class ActionableModelTest method testObjectIsAction.
/**
* Test execution when object is an action itself.
*/
@Test
void testObjectIsAction() {
clicked.set(true);
final Setup setup = new Setup(media);
final ObjectAction object = new ObjectAction(services, setup, executed);
final ActionableModel actionable = new ActionableModel(services, setup);
actionable.prepare(object);
actionable.update(1.0);
assertTrue(executed.get());
}
Aggregations