Class NonFreeSeaPirate

    • Field Detail

      • nearCity

        private final java.util.Optional<ICity> nearCity
      • hiringPlayer

        private final IPlayer hiringPlayer
      • hireDate

        private final java.time.LocalDateTime hireDate
    • Constructor Detail

      • NonFreeSeaPirate

        public NonFreeSeaPirate​(IPlayer hiringPlayer,
                                java.time.LocalDateTime hireDate,
                                ICity nearCity)
        Create a non free pirate.
        Parameters:
        hiringPlayer - player who hired the pirate
        hireDate - date on which the pirate was hired
        nearCity - if the pirate should operate near a city indicate it here, otherwise null.
    • Method Detail

      • roamingNearCity

        public java.util.Optional<ICity> roamingNearCity()
        Description copied from interface: INonFreeSeaPirate
        Indicates if the pirate is looting near the city.
        Specified by:
        roamingNearCity in interface INonFreeSeaPirate
        Returns:
        optional of the ICity. If it is empty, it means the pirate is not roaming near a city.