Exemple #1
0
  /** Check that random adds add Things to different squares assuming a free square is available */
  public void testRandomAdds() {
    Map map = new Map(2, 1);
    map.fillArea(0, 0, 1, 0, Tile.CAVEFLOOR);

    Thing a = new Thing();
    Thing b = new Thing();
    map.addThing(a);
    map.addThing(b);

    assertTrue(a.getMap() == map);
    assertTrue(b.getMap() == map);
    assertTrue(a.y == 0);
    assertTrue(b.y == 0);
    assertTrue(a.x != b.x);

    Thing c = new Thing();
    map.addThing(c);
    assertTrue(c.getMap() == map);
  }
Exemple #2
0
 public boolean handle(Thing t, Event ae) {
   Thing h = Game.hero();
   // Game.warn("EncounterAction: "+time);
   encounter(h.getMap(), h.x, h.y);
   return false;
 }