use of com.b3dgs.lionengine.ViewerMock 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());
}
use of com.b3dgs.lionengine.ViewerMock 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.ViewerMock 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.ViewerMock in project lionengine by b3dgs.
the class SpriteDigitTest method testSetLocationViewer.
/**
* Test set location with viewer.
*/
@Test
void testSetLocationViewer() {
final SpriteDigitImpl sprite = new SpriteDigitImpl(Graphics.createImageBuffer(64, 32), 1, 1, 1);
final ViewerMock viewer = new ViewerMock();
sprite.setLocation(viewer, Geom.createLocalizable(1.5, 2.5));
assertEquals(1.5, sprite.getX());
assertEquals(237.5, sprite.getY());
viewer.set(10, 20);
sprite.setLocation(viewer, Geom.createLocalizable(1.5, 2.5));
assertEquals(-8.5, sprite.getX());
assertEquals(257.5, sprite.getY());
}
use of com.b3dgs.lionengine.ViewerMock in project lionengine by b3dgs.
the class SpriteTiledTest method testSetLocationViewer.
/**
* Test set location with viewer.
*/
@Test
void testSetLocationViewer() {
final SpriteTiledImpl sprite = new SpriteTiledImpl(Graphics.createImageBuffer(64, 32), 16, 8);
final ViewerMock viewer = new ViewerMock();
sprite.setLocation(viewer, Geom.createLocalizable(1.5, 2.5));
assertEquals(1.5, sprite.getX());
assertEquals(237.5, sprite.getY());
assertEquals(2, sprite.getRenderX());
assertEquals(238, sprite.getRenderY());
viewer.set(10, 20);
sprite.setLocation(viewer, Geom.createLocalizable(1.5, 2.5));
assertEquals(-8.5, sprite.getX());
assertEquals(257.5, sprite.getY());
assertEquals(-8, sprite.getRenderX());
assertEquals(258, sprite.getRenderY());
}
Aggregations