use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.
the class MapTilePathModelTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
services.add(new Camera());
map.addFeature(new MapTileGroupModel());
map.create(1, 1, 7, 7);
UtilMap.setGroups(map);
UtilMap.fill(map, UtilMap.TILE_GROUND);
mapPath = map.addFeatureAndGet(new MapTilePathModel());
mapPath.prepare(map);
mapPath.loadPathfinding(Medias.create("pathfinding.xml"));
}
use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.
the class UtilAssignable method createServices.
/**
* Create the services.
*
* @param clicked The click flag.
* @param clickNumber The click number recorded.
* @return The services.
*/
public static Services createServices(final AtomicBoolean clicked, final AtomicInteger clickNumber) {
final Services services = new Services();
final Camera camera = services.create(Camera.class);
camera.setView(0, 0, 32, 32, 32);
final Cursor cursor = services.add(new Cursor() {
@Override
public boolean hasClickedOnce(int click) {
clickNumber.set(click);
return clicked.get();
}
});
cursor.setArea(0, 0, 64, 64);
cursor.setLocation(0, 1);
return services;
}
use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.
the class MapTileRasteredModelTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
services.add(new Camera());
viewer = services.add(new ViewerMock());
viewer.set(-20, -20);
map = services.add(new MapTileGame());
mapViewer = new MapTileViewerModel(services);
mapViewer.prepare(map);
mapRastered = new MapTileRasteredModel();
mapRastered.prepare(map);
}
use of com.b3dgs.lionengine.game.feature.Camera in project lionengine by b3dgs.
the class MapTileViewerModelTest method prepare.
/**
* Prepare test.
*/
@BeforeEach
public void prepare() {
services.add(new Camera());
viewer = services.add(new ViewerMock());
viewer.set(-20, -20);
map = services.add(new MapTileGame());
mapViewer = new MapTileViewerModel(services);
mapViewer.prepare(map);
}
use of com.b3dgs.lionengine.game.feature.Camera 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);
}
Aggregations