@Component public class CaptainsState extends Object
| Modifier and Type | Field and Description |
|---|---|
private List<CaptainTownMapping> |
captainMapping |
private Date |
date |
private IMap |
map |
private int |
maxFreeCaptains |
private int |
maxTimeInTown |
private PeopleFactory |
peopleFactory |
private Random |
rnd |
| Constructor and Description |
|---|
CaptainsState() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<ICaptain> |
getCaptain(ICity city)
Return a captain for a town if there is one.
|
private ICity |
getRandomCity() |
void |
hireCaptain(ICaptain captain,
ICity city)
Remove the captain from the availables.
|
void |
init(IMap map)
The initialisation can only happen after the map is properly initialized,
which only happens on game start.
|
@Autowired private Random rnd
@Value(value="${freeCaptain.max}")
private int maxFreeCaptains
@Value(value="${freeCaptain.timeInTown}")
private int maxTimeInTown
@Autowired private PeopleFactory peopleFactory
private IMap map
@Autowired private Date date
private List<CaptainTownMapping> captainMapping
public void init(IMap map)
map - private ICity getRandomCity()
public com.google.common.base.Optional<ICaptain> getCaptain(ICity city)
city - Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.