use of mudmap2.backend.World in project mudmap2 by Neop.
the class WorldPanelTest method testGetTileSize.
/**
* Test of get/setTileSize method, of class WorldPanel.
*/
@Test
public void testGetTileSize() {
System.out.println("getTileSize");
World world = new World();
WorldPanel instance = new WorldPanel(null, world, false);
double ts = 57.5;
instance.setTileSize(ts);
assertEquals(ts, instance.getTileSize(), 0.1);
}
use of mudmap2.backend.World in project mudmap2 by Neop.
the class WorldPanelTest method testGetCursorX.
/**
* Test of getCursorX method, of class WorldPanel.
*/
@Test
public void testGetCursorX() {
System.out.println("getCursorX");
World world = new World();
WorldPanel instance = new WorldPanel(null, world, false);
instance.setCursor(4, 6);
int result = instance.getCursorX();
assertEquals(4, result);
}
use of mudmap2.backend.World in project mudmap2 by Neop.
the class WorldPanelTest method testTileSizeDecrement.
/**
* Test of tileSizeDecrement method, of class WorldPanel.
*/
@Test
public void testTileSizeDecrement() {
System.out.println("tileSizeDecrement");
World world = new World();
WorldPanel instance = new WorldPanel(null, world, false);
double ts = 57.5;
instance.setTileSize(ts);
instance.tileSizeDecrement();
assertTrue(ts > instance.getTileSize());
}
use of mudmap2.backend.World in project mudmap2 by Neop.
the class WorldPanelTest method testSetHome.
/**
* Test of gotoHome method, of class WorldPanel.
*/
/*@Test
public void testGotoHome() {
System.out.println("gotoHome");
World world = new World();
WorldCoordinate home = new WorldCoordinate(1, 2, 3);
world.setHome(home);
WorldPanel instance = new WorldPanel(world, false);
instance.gotoHome();
assertEquals(home.getLayer(), instance.getPosition().getLayer());
assertEquals(home.getX(), instance.getPosition().getX(), 0.01);
assertEquals(home.getY(), instance.getPosition().getY(), 0.01);
}*/
/**
* Test of setHome method, of class WorldPanel.
*/
@Test
public void testSetHome() {
System.out.println("setHome");
World world = new World();
WorldCoordinate coord = new WorldCoordinate(1, 6, 9);
WorldPanel instance = new WorldPanel(null, world, false);
instance.pushPosition(coord);
// might be changed by moveScreenToCursor()
coord = instance.getPosition();
instance.setHome();
assertEquals(coord.getLayer(), world.getHome().getLayer());
assertEquals(coord.getX(), world.getHome().getX(), 0.01);
assertEquals(coord.getY(), world.getHome().getY(), 0.01);
}
use of mudmap2.backend.World in project mudmap2 by Neop.
the class WorldPanelTest method testGetCursorY.
/**
* Test of get/setCursorY method, of class WorldPanel.
*/
@Test
public void testGetCursorY() {
System.out.println("getCursorY");
World world = new World();
WorldPanel instance = new WorldPanel(null, world, false);
instance.setCursor(4, 6);
int result = instance.getCursorY();
assertEquals(6, result);
}
Aggregations