public class CityHallEngine extends AbstractEngine
| Modifier and Type | Class and Description |
|---|---|
private static class |
CityHallEngine.CityInitialisation |
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.util.CityUtilities |
citiesInteractionService |
private ch.sahits.game.openpatrician.model.city.cityhall.CityHallList |
cityHalls |
private com.google.common.eventbus.AsyncEventBus |
clientEventBus |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.Date |
date |
private ch.sahits.game.openpatrician.model.city.cityhall.EldermanCandidateList |
eldermanCandidates |
private EngineFactory |
engineFactory |
private CityHallEngine.CityInitialisation |
initialisation |
private LoanerEngine |
loanerEngine |
private ch.sahits.game.openpatrician.util.l10n.Locale |
locale |
private ch.sahits.game.openpatrician.model.IMap |
map |
private org.springframework.context.MessageSource |
messageSource |
private ch.sahits.game.openpatrician.model.people.PeopleFactory |
peopleFactory |
private ch.sahits.game.openpatrician.model.people.impl.SeaPiratesState |
pirateState |
private Random |
rnd |
private ch.sahits.game.openpatrician.model.factory.StateFactory |
stateFactory |
private ch.sahits.game.openpatrician.model.city.cityhall.EldermanTaskPlayerMap |
takenTasks |
private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList |
timedTaskListener |
private double |
weeklyHeadTaxMiddleClass |
private double |
weeklyHeadTaxPoor |
private double |
weeklyHeadTaxRich |
| Constructor and Description |
|---|
CityHallEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
assignTask(ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.city.cityhall.IEldermanTask task) |
private void |
checkPetitions(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
void |
checkPirateKilledEldermanTask(ShipAttackEvent event)
Check if the destroyed ship was a pirate ship that belongs to an elderman task.
|
private void |
checkTasksFinished(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office) |
private void |
checkViolations(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office,
ch.sahits.game.openpatrician.model.ICitizen elderman,
ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
private int |
countMilitia(List<ch.sahits.game.openpatrician.model.city.cityhall.ICityGuard> cityGuard,
Class<? extends ch.sahits.game.openpatrician.model.city.cityhall.ICityGuard> clazz) |
private void |
electNewElderman(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
private void |
electNewMayor(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
void |
establishCityHall(ch.sahits.game.openpatrician.model.city.ICity city) |
ch.sahits.game.openpatrician.model.city.cityhall.ICityHall |
findCityHall(ch.sahits.game.openpatrician.model.city.ICity city) |
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
private ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice |
getEldermanOffice() |
private int |
getLimit(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
Calculate the limit for a petition.
|
private int |
getLimit(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
Calculate the limit for a violation.
|
private void |
handleAcceptedCityPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
The city council accepted a petition, execute it.
|
private void |
handleCityViolationPunishment(ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
The Hanseatic council agreed on a punishment for a city violation, execute it.
|
void |
handleDailyUpdate(PeriodicalTimeDayUpdate event) |
private void |
handleDeniedCityPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
The city council decided against a petition, inform.
|
private void |
handleDeniedCityViolation(ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
The Hanseatic council decided not to punish a city for its violation, notify.
|
private void |
handleEldermansTask(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office) |
void |
handleEndOfYearUpdate(PeriodicalTimeYearEndUpdate event) |
void |
handleGameStartEvent(NewGameClient newGameClient) |
private void |
handleMayoralTasks(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
void |
handleMonthlyUpdate(PeriodicalTimeMonthEndUpdate event) |
void |
handleWeeklyUpdate(PeriodicalTimeWeekEndUpdate event) |
private void |
init() |
private void |
initializeBlockadeAction(ch.sahits.game.openpatrician.model.city.ICity city) |
private ch.sahits.game.openpatrician.model.city.cityhall.ICityHall |
initializeCity(ch.sahits.game.openpatrician.model.city.ICity city) |
private boolean |
isPlayer(ch.sahits.game.openpatrician.model.ICitizen mayor) |
private String |
leveySpecialTax(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ISpecialTaxPetition petition) |
private void |
notificationElectionWinner(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
Publish a message with the winner of the election.
|
private void |
unregister() |
private void |
updateEldermanTasks(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office) |
(package private) void |
updateTreasuryWeekly(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
Update the treasury.
|
private void |
voteOnPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
private void |
voteOnViolation(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
private double weeklyHeadTaxPoor
private double weeklyHeadTaxMiddleClass
private double weeklyHeadTaxRich
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired private ch.sahits.game.openpatrician.model.factory.StateFactory stateFactory
@Autowired private Random rnd
@Autowired private ch.sahits.game.openpatrician.model.Date date
@Autowired private ch.sahits.game.openpatrician.model.util.CityUtilities citiesInteractionService
@Autowired private ch.sahits.game.openpatrician.model.IMap map
@Autowired private ch.sahits.game.openpatrician.model.people.impl.SeaPiratesState pirateState
@Autowired private LoanerEngine loanerEngine
@Autowired private EngineFactory engineFactory
@Autowired private ch.sahits.game.openpatrician.model.people.PeopleFactory peopleFactory
@Autowired private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList timedTaskListener
@Autowired @Qualifier(value="clientEventBus") private com.google.common.eventbus.AsyncEventBus clientEventBus
@Autowired private ch.sahits.game.openpatrician.util.l10n.Locale locale
@Autowired private org.springframework.context.MessageSource messageSource
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.EldermanCandidateList eldermanCandidates
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.CityHallList cityHalls
private CityHallEngine.CityInitialisation initialisation
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.EldermanTaskPlayerMap takenTasks
@PostConstruct private void init()
@PreDestroy private void unregister()
public void handleWeeklyUpdate(PeriodicalTimeWeekEndUpdate event)
private void checkPetitions(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void checkViolations(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office,
ch.sahits.game.openpatrician.model.ICitizen elderman,
ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void checkTasksFinished(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office)
public void handleDailyUpdate(PeriodicalTimeDayUpdate event)
private void voteOnViolation(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void voteOnPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private int getLimit(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
cityHall - petition - private int getLimit(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
city - violation - private void electNewElderman(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void electNewMayor(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void notificationElectionWinner(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
cityHall - private void handleCityViolationPunishment(ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
violation - private void handleDeniedCityViolation(ch.sahits.game.openpatrician.model.city.cityhall.ICityViolation violation)
violation - private void handleAcceptedCityPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
cityHall - petition - private String leveySpecialTax(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall, ch.sahits.game.openpatrician.model.city.cityhall.ISpecialTaxPetition petition)
private void handleDeniedCityPetition(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall,
ch.sahits.game.openpatrician.model.city.cityhall.ICityPetition petition)
cityHall - petition - private void initializeBlockadeAction(ch.sahits.game.openpatrician.model.city.ICity city)
public void handleMonthlyUpdate(PeriodicalTimeMonthEndUpdate event)
private void handleEldermansTask(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office)
private void updateEldermanTasks(ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice office)
private void handleMayoralTasks(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private int countMilitia(List<ch.sahits.game.openpatrician.model.city.cityhall.ICityGuard> cityGuard, Class<? extends ch.sahits.game.openpatrician.model.city.cityhall.ICityGuard> clazz)
private boolean isPlayer(ch.sahits.game.openpatrician.model.ICitizen mayor)
public void handleEndOfYearUpdate(PeriodicalTimeYearEndUpdate event)
public List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEnginepublic void establishCityHall(ch.sahits.game.openpatrician.model.city.ICity city)
private ch.sahits.game.openpatrician.model.city.cityhall.ICityHall initializeCity(ch.sahits.game.openpatrician.model.city.ICity city)
public void handleGameStartEvent(NewGameClient newGameClient)
public ch.sahits.game.openpatrician.model.city.cityhall.ICityHall findCityHall(ch.sahits.game.openpatrician.model.city.ICity city)
public void assignTask(ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.city.cityhall.IEldermanTask task)
void updateTreasuryWeekly(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
public void checkPirateKilledEldermanTask(ShipAttackEvent event)
event - private ch.sahits.game.openpatrician.model.city.cityhall.IEldermanOffice getEldermanOffice()
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.