All Known Implementing Classes:
Tile

public interface ObservableTile
Interface to observe changes on a tile of a territory Provides access to its contents, and whether or not it is blocked. Also provides access to the hamsters list and the amount of grains on this tile for convenience.
  • Property Details

  • Method Details

    • grainCountProperty

      ReadOnlyIntegerProperty grainCountProperty()
      Getter for the grainCount property Always greater than or equal to 0 The content property contains as much ObservableGrains as the value of this property
      See Also:
      getGrainCount()
    • getGrainCount

      int getGrainCount()
      Returns the amount of grain on this tile. This is always greater than or equal to 0.
      Returns:
      the amount of grains
    • isBlockedProperty

      ReadOnlyBooleanProperty isBlockedProperty()
      Getter for the isBlocked property e.g. a tile is blocked if a wall is on it
      Returns:
      the property (not null)
    • isBlocked

      boolean isBlocked()
      Returns true if this tile is blocked. e.g. a tile is blocked if a wall is on it. A hamster cannot move on a blocked tile.
      Returns:
      true if this tile is blocked
    • contentProperty

      ReadOnlyListProperty<? extends ObservableTileContent> contentProperty()
      Getter for the content property Provides a read-only list of all contents on this tile
      See Also:
      getContent()
    • getContent

      List<? extends ObservableTileContent> getContent()
      Returns an unmodifiable list with all contents on this tile
      Returns:
      all contents on this tile (not null)
    • hamstersProperty

      ReadOnlyListProperty<? extends ObservableTileContent> hamstersProperty()
      Getter for the hamsters property Provides a read-only list of all hamsters on this tile, therefore this is a sublist of content
    • getLocation

      Location getLocation()
      the location of this tile on the territory
      Returns:
      the location (not null)
      See Also:
      ObservableTerritory