Search in sources :

Example 31 with World

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);
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 32 with World

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);
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 33 with World

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());
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Example 34 with World

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);
}
Also used : WorldCoordinate(mudmap2.backend.WorldCoordinate) World(mudmap2.backend.World) Test(org.junit.Test)

Example 35 with World

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);
}
Also used : World(mudmap2.backend.World) Test(org.junit.Test)

Aggregations

World (mudmap2.backend.World)31 Test (org.junit.Test)27 IOException (java.io.IOException)11 FileNotFoundException (java.io.FileNotFoundException)9 Place (mudmap2.backend.Place)9 File (java.io.File)7 WorldFileDefault (mudmap2.backend.WorldFileReader.current.WorldFileDefault)7 Layer (mudmap2.backend.Layer)6 Path (mudmap2.backend.Path)6 WorldCoordinate (mudmap2.backend.WorldCoordinate)6 Color (java.awt.Color)5 HashMap (java.util.HashMap)5 WorldFile (mudmap2.backend.WorldFileReader.WorldFile)5 PlaceGroup (mudmap2.backend.PlaceGroup)4 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 Map (java.util.Map)3 JLabel (javax.swing.JLabel)3 RiskLevel (mudmap2.backend.RiskLevel)3 BorderLayout (java.awt.BorderLayout)2