Class BaseTavernPerson

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void arrive()
      Person arrives in the tavern.
      int getMaxDaysAbsent()
      Maximum number of days not present in the tavern.
      int getMaxDaysPresent()
      Retrieve the max number of days present in the tavern.
      int getNumberOfDaysSinceArrival()
      Compute the days of absence since the last arrival, if the person is not present.
      private void initArival()  
      boolean isPresent()
      Flag indicating if the person is present in the tavern.
      javafx.beans.property.BooleanProperty isPresentProperty()
      Property defining the presence/absence state.
      void leave()
      Person leaves the tavern
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • arrivalDate

        private java.time.LocalDateTime arrivalDate
        Arrival date of the person in the tavern. Is null as long as isPresent is false for the first time
      • isPresent

        private javafx.beans.property.BooleanProperty isPresent
        Indicating if the person is currently present
      • date

        @Autowired
        protected Date date
      • clientServerEventBus

        @Autowired
        @Qualifier("serverClientEventBus")
        private com.google.common.eventbus.AsyncEventBus clientServerEventBus
      • city

        private ICity city
      • rnd

        @Autowired
        private java.util.Random rnd
    • Constructor Detail

      • BaseTavernPerson

        public BaseTavernPerson()
    • Method Detail

      • initArival

        @PostConstruct
        private void initArival()
      • isPresent

        public boolean isPresent()
        Description copied from interface: ITavernPerson
        Flag indicating if the person is present in the tavern.
        Specified by:
        isPresent in interface ITavernPerson
        Returns:
        true if the person is present.
      • isPresentProperty

        public javafx.beans.property.BooleanProperty isPresentProperty()
        Description copied from interface: ITavernPerson
        Property defining the presence/absence state.
        Specified by:
        isPresentProperty in interface ITavernPerson
        Returns:
        boolean proerty indicating the presence in the tavern.
      • arrive

        public final void arrive()
        Person arrives in the tavern.
        Specified by:
        arrive in interface ITavernPerson
      • leave

        public final void leave()
        Person leaves the tavern
        Specified by:
        leave in interface ITavernPerson
      • getNumberOfDaysSinceArrival

        public int getNumberOfDaysSinceArrival()
        Description copied from interface: ITavernPerson
        Compute the days of absence since the last arrival, if the person is not present.
        Specified by:
        getNumberOfDaysSinceArrival in interface ITavernPerson
        Returns:
        number of days the person is in the tavern
      • getMaxDaysAbsent

        public int getMaxDaysAbsent()
        Description copied from interface: ITavernPerson
        Maximum number of days not present in the tavern.
        Specified by:
        getMaxDaysAbsent in interface ITavernPerson
        Returns:
        max number of absent days.
      • getMaxDaysPresent

        public int getMaxDaysPresent()
        Description copied from interface: ITavernPerson
        Retrieve the max number of days present in the tavern.
        Specified by:
        getMaxDaysPresent in interface ITavernPerson
        Returns:
        max number of present days in the tavern