Search in sources :

Example 1 with IdentifiableModel

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

the class UtilAssignable method createAssignable.

/**
 * Create the assignable.
 *
 * @param services The services.
 * @return The prepared assignable.
 */
public static AssignableModel createAssignable(Services services) {
    final Featurable featurable = new FeaturableModel();
    featurable.addFeature(new IdentifiableModel());
    final AssignableModel assignable = new AssignableModel(services);
    assignable.prepare(featurable);
    return assignable;
}
Also used : FeaturableModel(com.b3dgs.lionengine.game.feature.FeaturableModel) IdentifiableModel(com.b3dgs.lionengine.game.feature.IdentifiableModel) Featurable(com.b3dgs.lionengine.game.feature.Featurable)

Example 2 with IdentifiableModel

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

the class AttackerModelTest method prepare.

/**
 * Prepare test.
 */
@Before
public void prepare() {
    UtilAttackable.prepare(object);
    object.addFeature(new IdentifiableModel());
    attacker = UtilAttackable.createAttacker(object, services);
}
Also used : IdentifiableModel(com.b3dgs.lionengine.game.feature.IdentifiableModel) Before(org.junit.Before)

Example 3 with IdentifiableModel

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

the class UtilLaunchable method createLaunchable.

/**
 * Create launchable.
 *
 * @param services The services.
 * @param featurable The featurable.
 * @return The launchable.
 */
public static Launchable createLaunchable(Services services, Featurable featurable) {
    featurable.addFeature(new IdentifiableModel());
    featurable.addFeature(new TransformableModel());
    final Launchable launchable = new LaunchableModel();
    launchable.prepare(featurable);
    launchable.setLocation(0.0, 0.0);
    launchable.setVector(new Force(0.0, 1.0));
    return launchable;
}
Also used : TransformableModel(com.b3dgs.lionengine.game.feature.TransformableModel) Force(com.b3dgs.lionengine.game.Force) IdentifiableModel(com.b3dgs.lionengine.game.feature.IdentifiableModel)

Example 4 with IdentifiableModel

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

the class UtilExtractable method createExtractable.

/**
 * Create extractable.
 *
 * @return The extractable.
 */
public static Extractable createExtractable() {
    final Services services = new Services();
    services.add(new MapTileGame());
    final Featurable featurable = new FeaturableModel();
    featurable.addFeature(new IdentifiableModel());
    featurable.addFeature(new TransformableModel());
    final Extractable extractable = new ExtractableModel(services);
    extractable.setResourcesQuantity(10);
    extractable.setResourcesType(ResourceType.WOOD);
    extractable.prepare(featurable);
    return extractable;
}
Also used : Services(com.b3dgs.lionengine.game.feature.Services) TransformableModel(com.b3dgs.lionengine.game.feature.TransformableModel) MapTileGame(com.b3dgs.lionengine.game.feature.tile.map.MapTileGame) FeaturableModel(com.b3dgs.lionengine.game.feature.FeaturableModel) IdentifiableModel(com.b3dgs.lionengine.game.feature.IdentifiableModel) Featurable(com.b3dgs.lionengine.game.feature.Featurable)

Aggregations

IdentifiableModel (com.b3dgs.lionengine.game.feature.IdentifiableModel)4 Featurable (com.b3dgs.lionengine.game.feature.Featurable)2 FeaturableModel (com.b3dgs.lionengine.game.feature.FeaturableModel)2 TransformableModel (com.b3dgs.lionengine.game.feature.TransformableModel)2 Force (com.b3dgs.lionengine.game.Force)1 Services (com.b3dgs.lionengine.game.feature.Services)1 MapTileGame (com.b3dgs.lionengine.game.feature.tile.map.MapTileGame)1 Before (org.junit.Before)1