Class BaseTavernPerson
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.people.impl.BaseTavernPerson
-
- All Implemented Interfaces:
IPerson,ITavernPerson
- Direct Known Subclasses:
BasePatrolState,BuyerState,ConcurrentState,EscorteeState,FugitiveState,InformantState,PirateHunterState,SmugglerState,TavernPirateState,ThieveState,TraderState,TransportTraderState,TravelerState,TreasureMapOwnerState,WarehouseTenant
public class BaseTavernPerson extends java.lang.Object implements ITavernPerson
Base class for people frequenting the tavern.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 20, 2013
-
-
Constructor Summary
Constructors Constructor Description BaseTavernPerson()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarrive()Person arrives in the tavern.intgetMaxDaysAbsent()Maximum number of days not present in the tavern.intgetMaxDaysPresent()Retrieve the max number of days present in the tavern.intgetNumberOfDaysSinceArrival()Compute the days of absence since the last arrival, if the person is not present.booleanisPresent()Flag indicating if the person is present in the tavern.javafx.beans.property.BooleanPropertyisPresentProperty()Property defining the presence/absence state.voidleave()Person leaves the tavern-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.ITavernPerson
getArrivalDate, setCity
-
-
-
-
Field Detail
-
date
@Autowired protected Date date
-
-
Method Detail
-
isPresent
public boolean isPresent()
Description copied from interface:ITavernPersonFlag indicating if the person is present in the tavern.- Specified by:
isPresentin interfaceITavernPerson- Returns:
- true if the person is present.
-
isPresentProperty
public javafx.beans.property.BooleanProperty isPresentProperty()
Description copied from interface:ITavernPersonProperty defining the presence/absence state.- Specified by:
isPresentPropertyin interfaceITavernPerson- Returns:
- boolean proerty indicating the presence in the tavern.
-
arrive
public final void arrive()
Person arrives in the tavern.- Specified by:
arrivein interfaceITavernPerson
-
leave
public final void leave()
Person leaves the tavern- Specified by:
leavein interfaceITavernPerson
-
getNumberOfDaysSinceArrival
public int getNumberOfDaysSinceArrival()
Description copied from interface:ITavernPersonCompute the days of absence since the last arrival, if the person is not present.- Specified by:
getNumberOfDaysSinceArrivalin interfaceITavernPerson- Returns:
- number of days the person is in the tavern
-
getMaxDaysAbsent
public int getMaxDaysAbsent()
Description copied from interface:ITavernPersonMaximum number of days not present in the tavern.- Specified by:
getMaxDaysAbsentin interfaceITavernPerson- Returns:
- max number of absent days.
-
getMaxDaysPresent
public int getMaxDaysPresent()
Description copied from interface:ITavernPersonRetrieve the max number of days present in the tavern.- Specified by:
getMaxDaysPresentin interfaceITavernPerson- Returns:
- max number of present days in the tavern
-
-