@Test public void testEquals() { assert (testGasTile.equals(new TileSolid(Tiles.AIR))); assert (!testGasTile.equals(testSolidTile)); assert (!testGasTile.equals(new TileSolid(Tiles.DIRT))); assert (testGasTile.hashCode() == testGasTile.hashCode()); assert (testGasTile.hashCode() == (new TileSolid(Tiles.AIR)).hashCode()); assert (testGasTile.hashCode() != testSolidTile.hashCode()); assert (testGasTile.hashCode() != (new TileGas(Tiles.DIRT)).hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof TileInfo)) { return false; } TileInfo tileInfo = (TileInfo) o; return type.equals(tileInfo.type); }
TileInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof TileInfo)) { return false; } TileInfo tileInfo = (TileInfo) o; return type.equals(tileInfo.type); } }
TileInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof TileInfo)) { return false; } TileInfo tileInfo = (TileInfo) o; return type.equals(tileInfo.type); } TileInfo(Tiles type); }
TileInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof TileInfo)) { return false; } TileInfo tileInfo = (TileInfo) o; return type.equals(tileInfo.type); } TileInfo(Tiles type); static Map<Tiles, TileInfo> getTileRegistry(); static boolean hasLoaded(); static void registerTiles(); static void clearRegistry(); static TileInfo get(Tiles type); Map<String, String> getSpriteFilenames(); TileInfo setDefaultFilename(String filename); int getBlockWidth(); int getBlockHeight(); int getNumSpriteFrames(); int getSpriteFrameDuration(); Tiles getType(); String getDisplayName(); TileInfo setDisplayName(String displayName); boolean isNaturalSurface(); boolean isDestructible(); TileInfo getBackgroundTile(); TileInfo getDamagedTile(); TileInfo setBackgroundTile(Tiles backgroundTile); TileInfo setDamagedTile(Tiles damagedTile); TileInfo setNaturalSurface(boolean naturalSurface); TileInfo setDestructible(boolean destructible); abstract boolean isObstacle(); abstract boolean isLiquid(); void onEntityOnTopOfBlock(Entity entity, Tile tile, long ms); List<String> getVariants(); @Override boolean equals(Object o); @Override int hashCode(); }
TileInfo { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || !(o instanceof TileInfo)) { return false; } TileInfo tileInfo = (TileInfo) o; return type.equals(tileInfo.type); } TileInfo(Tiles type); static Map<Tiles, TileInfo> getTileRegistry(); static boolean hasLoaded(); static void registerTiles(); static void clearRegistry(); static TileInfo get(Tiles type); Map<String, String> getSpriteFilenames(); TileInfo setDefaultFilename(String filename); int getBlockWidth(); int getBlockHeight(); int getNumSpriteFrames(); int getSpriteFrameDuration(); Tiles getType(); String getDisplayName(); TileInfo setDisplayName(String displayName); boolean isNaturalSurface(); boolean isDestructible(); TileInfo getBackgroundTile(); TileInfo getDamagedTile(); TileInfo setBackgroundTile(Tiles backgroundTile); TileInfo setDamagedTile(Tiles damagedTile); TileInfo setNaturalSurface(boolean naturalSurface); TileInfo setDestructible(boolean destructible); abstract boolean isObstacle(); abstract boolean isLiquid(); void onEntityOnTopOfBlock(Entity entity, Tile tile, long ms); List<String> getVariants(); @Override boolean equals(Object o); @Override int hashCode(); static final int BLOCK_WIDTH; static final int BLOCK_HEIGHT; }