@Component @Lazy @DependentInitialisation(StartNewGameBean.class) public class CaptainsState extends java.lang.Object
| Constructor | Description |
|---|---|
CaptainsState() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addCaptain(ICity city,
java.time.LocalDateTime arrival,
ICaptain captain) |
|
void |
assignCaptainToCity(ICaptain captain,
ICity city,
java.time.LocalDateTime arrivalDate) |
Assign the captain to a new town.
|
java.util.Optional<ICity> |
findCaptainsCurrentCity(ICaptain captain) |
Find the current city of a captain.
|
java.util.List<ICaptain> |
getAllFreeCaptains() |
Retrieve a list of all captains that are not assigned to a town.
|
java.time.LocalDateTime |
getArrivalDate(ICaptain captain) |
Retrieve the arrival date of a captain in a town.
|
java.util.Optional<ICaptain> |
getCaptain(ICity city) |
Return a captain for a town if there is one.
|
void |
hireCaptain(ICaptain captain,
ICity city) |
Remove the captain from the availables.
|
public void assignCaptainToCity(ICaptain captain, ICity city, java.time.LocalDateTime arrivalDate)
city - current town that the captain is leavingcaptain - which travels to a new town.public java.util.Optional<ICaptain> getCaptain(ICity city)
city - for which the captain is retrievedpublic java.time.LocalDateTime getArrivalDate(ICaptain captain)
captain - captain residing in a townpublic void hireCaptain(ICaptain captain, ICity city)
captain - that is hired.city - where the captain was hired.public java.util.List<ICaptain> getAllFreeCaptains()
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.