@Test public void testEquals() { final WorldMap map2 = new WorldMap("foo", 1, (short) 1, new Tile[] {}); final WorldMap map3 = new WorldMap("foo", 2, (short) 1, new Tile[] {}); final WorldMap map4 = new WorldMap("asd", 1, (short) 1, new Tile[] {}); final WorldMap map5 = new WorldMap("asd", 3, (short) 1, new Tile[] {null}); final WorldMap map6 = new WorldMap(null, 4, (short) 1, new Tile[] {}); assertEquals(map, map); assertEquals(map2, map); assertThat(map, not(equalTo(map3))); assertThat(map, not(equalTo(map4))); assertThat(map, not(equalTo(map5))); assertThat(map6, not(equalTo(map))); assertThat(map, not(equalTo(null))); assertThat(map, not(equalTo(new String()))); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WorldMap other = (WorldMap) obj; if (id != other.id) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (!Arrays.equals(tiles, other.tiles)) { return false; } if (version != other.version) { return false; } return true; }
WorldMap { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WorldMap other = (WorldMap) obj; if (id != other.id) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (!Arrays.equals(tiles, other.tiles)) { return false; } if (version != other.version) { return false; } return true; } }
WorldMap { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WorldMap other = (WorldMap) obj; if (id != other.id) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (!Arrays.equals(tiles, other.tiles)) { return false; } if (version != other.version) { return false; } return true; } WorldMap(final String name, final int id, final short version, final Tile[] tiles); }
WorldMap { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WorldMap other = (WorldMap) obj; if (id != other.id) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (!Arrays.equals(tiles, other.tiles)) { return false; } if (version != other.version) { return false; } return true; } WorldMap(final String name, final int id, final short version, final Tile[] tiles); short getVersion(); Tile getTile(int x, int y); static int getTileKey(final int x, final int y); String getName(); int getId(); List<Character> getCharactersNearby(int x, int y); void putCharacterAtPos(Character chara, byte x, byte y); @Override int hashCode(); @Override boolean equals(Object obj); Tile getNearestAvailableTile(byte x, byte y, byte maxDistance, boolean includeGroundTiles,
			boolean includeWaterTiles, boolean includeLavaTiles, boolean includeExitTiles); boolean isTileAvailable(byte x, byte y, boolean canBeGround, boolean canBeWater, boolean canBeLava,
			boolean canBeExitTile); void moveCharacterTo(final Character character, final byte x, final byte y); }
WorldMap { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WorldMap other = (WorldMap) obj; if (id != other.id) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (!Arrays.equals(tiles, other.tiles)) { return false; } if (version != other.version) { return false; } return true; } WorldMap(final String name, final int id, final short version, final Tile[] tiles); short getVersion(); Tile getTile(int x, int y); static int getTileKey(final int x, final int y); String getName(); int getId(); List<Character> getCharactersNearby(int x, int y); void putCharacterAtPos(Character chara, byte x, byte y); @Override int hashCode(); @Override boolean equals(Object obj); Tile getNearestAvailableTile(byte x, byte y, byte maxDistance, boolean includeGroundTiles,
			boolean includeWaterTiles, boolean includeLavaTiles, boolean includeExitTiles); boolean isTileAvailable(byte x, byte y, boolean canBeGround, boolean canBeWater, boolean canBeLava,
			boolean canBeExitTile); void moveCharacterTo(final Character character, final byte x, final byte y); static final int MAP_WIDTH; static final int MAP_HEIGHT; static final int VISIBLE_AREA_WIDTH; static final int VISIBLE_AREA_HEIGHT; static final int MAX_DISTANCE; static final int MAX_X; static final int MAX_Y; static final int MIN_X; static final int MIN_Y; }