Пример #1
0
  /**
   * Get a propety given to a particular tile. Note that this method will not perform well and
   * should not be used as part of the default code path in the game loop.
   *
   * @param tileID The global ID of the tile to retrieve
   * @param propertyName The name of the property to retireve
   * @param def The default value to return
   * @return The value assigned to the property on the tile (or the default value if none is
   *     supplied)
   */
  public String getTileProperty(int tileID, String propertyName, String def) {
    if (tileID == 0) {
      return def;
    }

    TileSet set = findTileSet(tileID);

    Properties props = set.getProperties(tileID);
    if (props == null) {
      return def;
    }
    return props.getProperty(propertyName, def);
  }