Class NonFreeSeaPirate
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.people.impl.SeaPirate
-
- ch.sahits.game.openpatrician.model.people.impl.NonFreeSeaPirate
-
- All Implemented Interfaces:
INonFreeSeaPirate
,ISeaPirate
,IShipOwner
public class NonFreeSeaPirate extends SeaPirate implements INonFreeSeaPirate
Implementation of a non free pirate.
-
-
Field Summary
Fields Modifier and Type Field Description private java.time.LocalDateTime
hireDate
private IPlayer
hiringPlayer
private java.util.Optional<ICity>
nearCity
-
Constructor Summary
Constructors Constructor Description NonFreeSeaPirate(IPlayer hiringPlayer, java.time.LocalDateTime hireDate, ICity nearCity)
Create a non free pirate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ICity>
roamingNearCity()
Indicates if the pirate is looting near the city.-
Methods inherited from class ch.sahits.game.openpatrician.model.people.impl.SeaPirate
incNumberOfKills
-
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.INonFreeSeaPirate
getHireDate, getHiringPlayer
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.ISeaPirate
getName, getNumberOfKills, getShip
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.IShipOwner
getLastName
-
-
-
-
Constructor Detail
-
NonFreeSeaPirate
public NonFreeSeaPirate(IPlayer hiringPlayer, java.time.LocalDateTime hireDate, ICity nearCity)
Create a non free pirate.- Parameters:
hiringPlayer
- player who hired the piratehireDate
- date on which the pirate was hirednearCity
- 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 interfaceINonFreeSeaPirate
- Returns:
- optional of the ICity. If it is empty, it means the pirate is not roaming near a city.
-
-