public class EventEngineState extends Object
| Modifier and Type | Field and Description |
|---|---|
private Map<ch.sahits.game.openpatrician.model.city.ICity,org.joda.time.DateTime> |
lastFire |
private Map<ch.sahits.game.openpatrician.model.city.ICity,org.joda.time.DateTime> |
lastPlague |
private Map<ch.sahits.game.openpatrician.model.IPlayer,EEventState> |
marriageState |
| Constructor and Description |
|---|
EventEngineState() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFire(ch.sahits.game.openpatrician.model.city.ICity city,
org.joda.time.DateTime date)
Add or override the date of the last fire in the city
|
void |
addPlague(ch.sahits.game.openpatrician.model.city.ICity city,
org.joda.time.DateTime date)
Add or override the date of the last plague in the city
|
Optional<org.joda.time.DateTime> |
getLastFire(ch.sahits.game.openpatrician.model.city.ICity city)
Retrieve the Date of the last fire.
|
Optional<org.joda.time.DateTime> |
getLastPlague(ch.sahits.game.openpatrician.model.city.ICity city)
Retrieve the Date of the last plague.
|
Optional<EEventState> |
getMarriageState(ch.sahits.game.openpatrician.model.IPlayer player)
Retrieve the current marriage state of the player.
|
void |
resetMarriedState(ch.sahits.game.openpatrician.model.IPlayer player)
Remove the player form the marriage state map.
|
void |
setMarriageState(ch.sahits.game.openpatrician.model.IPlayer player,
EEventState state)
Set or update the marriage state of a player.
|
private Map<ch.sahits.game.openpatrician.model.city.ICity,org.joda.time.DateTime> lastFire
private Map<ch.sahits.game.openpatrician.model.city.ICity,org.joda.time.DateTime> lastPlague
private Map<ch.sahits.game.openpatrician.model.IPlayer,EEventState> marriageState
public void addFire(ch.sahits.game.openpatrician.model.city.ICity city,
org.joda.time.DateTime date)
city - where the fire happeneddate - when the fire happenedpublic Optional<org.joda.time.DateTime> getLastFire(ch.sahits.game.openpatrician.model.city.ICity city)
city - which should be checkedpublic void addPlague(ch.sahits.game.openpatrician.model.city.ICity city,
org.joda.time.DateTime date)
city - where the plague happeneddate - when the plague happenedpublic Optional<org.joda.time.DateTime> getLastPlague(ch.sahits.game.openpatrician.model.city.ICity city)
city - which should be checkedpublic void setMarriageState(ch.sahits.game.openpatrician.model.IPlayer player,
EEventState state)
player - to be updatedstate - marriage statepublic Optional<EEventState> getMarriageState(ch.sahits.game.openpatrician.model.IPlayer player)
player - to be checked.public void resetMarriedState(ch.sahits.game.openpatrician.model.IPlayer player)
player - that gets married.Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.