示例#1
0
  @Override
  public boolean equals(Object obj) {
    if (obj == this) return true;
    if (!(obj instanceof TownBlock)) return false;

    TownBlock o = (TownBlock) obj;
    return this.getX() == o.getX() && this.getZ() == o.getZ() && this.getWorld() == o.getWorld();
  }
示例#2
0
 public List<TownBlock> getTownBlocks(Town town) {
   List<TownBlock> out = new ArrayList<TownBlock>();
   for (TownBlock townBlock : town.getTownBlocks())
     if (townBlock.getWorld() == this) out.add(townBlock);
   return out;
 }