Interface Location

    • Method Detail

      • getTile

        Tile getTile()
        Gets the Tile associated with this Location.
        Returns:
        The Tile associated with this Location, or null if none found.
      • getLocationLabel

        StringTemplate getLocationLabel()
        Get a label for this location.
        Returns:
        A label for this location.
      • getLocationLabelFor

        StringTemplate getLocationLabelFor​(Player player)
        Get a label for this location for a particular player.
        Parameters:
        player - The Player to return the name for.
        Returns:
        A label for this location.
      • add

        boolean add​(Locatable locatable)
        Adds a Locatable to this Location.
        Parameters:
        locatable - The Locatable to add to this Location.
        Returns:
        True if the locatable was added.
      • remove

        boolean remove​(Locatable locatable)
        Removes a Locatable from this Location.
        Parameters:
        locatable - The Locatable to remove from this Location.
        Returns:
        True if the locatable was removed.
      • contains

        boolean contains​(Locatable locatable)
        Checks if this Location contains the specified Locatable.
        Parameters:
        locatable - The Locatable to test the presence of.
        Returns:
        True if the locatable is present at this location.
      • canAdd

        boolean canAdd​(Locatable locatable)
        Checks whether or not the specified locatable may be added to this Location.
        Parameters:
        locatable - The Locatable to add.
        Returns:
        True if the locatable can be added to this location.
      • getUnitCount

        int getUnitCount()
        Gets the number of units at this Location.
        Returns:
        The number of units at this Location.
      • getUnits

        java.util.stream.Stream<Unit> getUnits()
        Gets a stream of all the units present at this location.
        Returns:
        A stream of all the units at this location.
      • getUnitList

        java.util.List<Unit> getUnitList()
        Gets a list of all the units present at this location.
        Returns:
        A list of all the units at this location.
      • getGoodsContainer

        GoodsContainer getGoodsContainer()
        Gets the GoodsContainer this Location use for storing it's goods.
        Returns:
        The GoodsContainer or null if the Location cannot store any goods.
      • getSettlement

        Settlement getSettlement()
        Gets the Settlement this Location is located in.
        Returns:
        The associated Settlement, or null if none.
      • getColony

        Colony getColony()
        Get the colony at this location.
        Returns:
        A Colony at this location if any, or null if none found.
      • getIndianSettlement

        IndianSettlement getIndianSettlement()
        Gets the native settlement at this location.
        Returns:
        The IndianSettlement at this location if any, or null if none found.
      • up

        Location up()
        Promote this location to a more meaningful one if possible. For example: a settlement is more meaningful than the tile it occupies.
        Returns:
        A more meaningful Location, or this one.
      • getRank

        int getRank()
        Get a integer for this location, for the benefit of location comparators.
        Returns:
        A suitable integer.
      • toShortString

        java.lang.String toShortString()
        Get a short description of this location.
        Returns:
        A short description.
      • upLoc

        static Location upLoc​(Location loc)
        Static frontend to up().
        Parameters:
        loc - The Location to improve.
        Returns:
        The improved Location.
      • rankOf

        static int rankOf​(Location loc)
        Static front end to getRank.
        Parameters:
        loc - A Location to check.
        Returns:
        The integer rank of the given location.
      • getLocationImageKey

        default java.lang.String getLocationImageKey()
        Get an image key for this location.
        Returns:
        A key for image lookup, null by default.