Class InformantState

  • All Implemented Interfaces:
    IInformant, IPerson, ITavernPerson

    public class InformantState
    extends BaseTavernPerson
    implements IInformant
    Implementation of a informant. Every city can have a informant and is referenced through it's TavernEngine.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 20, 2013
    • Field Detail

      • rnd

        @Autowired
        private java.util.Random rnd
      • price

        private int price
      • name

        private java.lang.String name
      • wareNeeded

        private java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,​IWare>> wareNeeded
      • wareSurplus

        private java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,​IWare>> wareSurplus
      • pirateLocation

        private java.util.Optional<ch.sahits.datastructure.GenericPair<java.lang.String,​ICity>> pirateLocation
      • showMapIfAvailable

        private boolean showMapIfAvailable
    • Constructor Detail

      • InformantState

        public InformantState()
    • Method Detail

      • getPrice

        public int getPrice​(IPlayer player)
        Description copied from interface: IInformant
        Get the price of the information.
        Specified by:
        getPrice in interface IInformant
        Parameters:
        player - requesting the price
        Returns:
        price tag for the information
      • getMapSectionPart

        public java.util.Optional<MapSegmentedImage> getMapSectionPart​(IPlayer player)
        Description copied from interface: IInformant
        The informant may also hold a map part for the player.
        Specified by:
        getMapSectionPart in interface IInformant
        Parameters:
        player - requesting player
        Returns:
        Optional of the MapSegmentedImage. Empty if there is no map segment for hte player
      • setPirateLocation

        public void setPirateLocation​(ISeaPirate pirate,
                                      ICity city)
        Description copied from interface: IInformant
        Set the location of the pirate.
        Specified by:
        setPirateLocation in interface IInformant
        Parameters:
        pirate - for whom there is information available
        city - near which the pirate has been seen.
      • setNeededWare

        public void setNeededWare​(ICity city,
                                  IWare ware)
        Description copied from interface: IInformant
        Set the information about the needed ware in the city.
        Specified by:
        setNeededWare in interface IInformant
        Parameters:
        city - which needs ware
        ware - that is needed
      • setWareSurplus

        public void setWareSurplus​(ICity city,
                                   IWare ware)
        Description copied from interface: IInformant
        Set the information about the surplus ware in the city
        Specified by:
        setWareSurplus in interface IInformant
        Parameters:
        city - which has surplus on wares
        ware - that is available in abundance