Interface IInformant

  • All Superinterfaces:
    IPerson, ITavernPerson
    All Known Implementing Classes:
    InformantState

    public interface IInformant
    extends ITavernPerson
    Provide the information the informant is willing to sell. The bits of information are optional, but one bit is always present.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 24, 2013
    • Method Detail

      • getPrice

        int getPrice​(IPlayer player)
        Get the price of the information.
        Parameters:
        player - requesting the price
        Returns:
        price tag for the information
      • getName

        java.lang.String getName()
        Retreive the name of the informant
        Returns:
        name of the informant.
      • getWareNeeded

        java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,​IWare>> getWareNeeded()
        Possible information about in which city which ware is needed.
        Returns:
        Optional GenericPair of city and ware for missing wares.
      • getWareSurplus

        java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,​IWare>> getWareSurplus()
        Possible information about in which city which ware is available in surplus.
        Returns:
        Optional GenericPair of city and ware whith surplus of ware.
      • getPirateLocation

        java.util.Optional<ch.sahits.datastructure.GenericPair<java.lang.String,​ICity>> getPirateLocation()
        Possible information about the location of a pirate.
        Returns:
        Optional GenericPair of pirate name and city where the pirate is rumored to be.
      • setNeededWare

        void setNeededWare​(ICity city,
                           IWare ware)
        Set the information about the needed ware in the city.
        Parameters:
        city - which needs ware
        ware - that is needed
      • setWareSurplus

        void setWareSurplus​(ICity city,
                            IWare ware)
        Set the information about the surplus ware in the city
        Parameters:
        city - which has surplus on wares
        ware - that is available in abundance
      • setPirateLocation

        void setPirateLocation​(ISeaPirate pirate,
                               ICity city)
        Set the location of the pirate.
        Parameters:
        pirate - for whom there is information available
        city - near which the pirate has been seen.
      • getMapSectionPart

        java.util.Optional<MapSegmentedImage> getMapSectionPart​(IPlayer player)
        The informant may also hold a map part for the player.
        Parameters:
        player - requesting player
        Returns:
        Optional of the MapSegmentedImage. Empty if there is no map segment for hte player
      • isShowMapIfAvailable

        boolean isShowMapIfAvailable()
        Indicate if the informant has a piece of a map.
        Returns:
        true if the informant sells a piece of a map.
      • setShowMapIfAvailable

        void setShowMapIfAvailable​(boolean showMapIfAvailable)
        Set the flag for the map piece
        Parameters:
        showMapIfAvailable - true if the informant has a map piece
      • setPrice

        void setPrice​(int price)
        Set the price of the information
        Parameters:
        price - of hte information
      • setName

        void setName​(java.lang.String name)
        Set the name of the informant
        Parameters:
        name - of the informant