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.city.cityhall.AldermanCandidateList |
aldermanCandidates |
private ch.sahits.game.openpatrician.model.city.cityhall.impl.AldermanOffice |
aldermanOffice |
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 |
clientServerEventBus |
private DependentAnnotationConfigApplicationContext |
context |
private ch.sahits.game.openpatrician.model.Date |
date |
private EngineFactory |
engineFactory |
private CityHallEngine.CityInitialisation |
initialisation |
private LoanerEngine |
loanerEngine |
private ch.sahits.game.openpatrician.util.l10n.Locale |
locale |
private org.apache.logging.log4j.Logger |
logger |
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.AldermanTaskPlayerMap |
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.IAldermanTask task) |
private void |
checkPetitions(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall) |
void |
checkPirateKilledAldermanTask(ShipAttackEvent event)
Check if the destroyed ship was a pirate ship that belongs to an alderman task.
|
private void |
checkTasksFinished(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice office) |
private void |
checkViolations(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice office,
ch.sahits.game.openpatrician.model.ICitizen alderman,
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 |
electNewAlderman(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) |
private ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice |
getAldermanOffice() |
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
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 |
handleAldermansTask(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice office) |
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.
|
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) |
(package private) boolean |
isHumanPlayer(ch.sahits.game.openpatrician.model.ICitizen mayor) |
private ch.sahits.game.openpatrician.model.DisplayMessage |
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 |
updateAldermanTasks(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice 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 final org.apache.logging.log4j.Logger logger
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 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.AldermanCandidateList aldermanCandidates
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.CityHallList cityHalls
private CityHallEngine.CityInitialisation initialisation
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.AldermanTaskPlayerMap takenTasks
@Autowired private ch.sahits.game.openpatrician.model.city.cityhall.impl.AldermanOffice aldermanOffice
@Autowired private DependentAnnotationConfigApplicationContext context
@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.IAldermanOffice office,
ch.sahits.game.openpatrician.model.ICitizen alderman,
ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
private void checkTasksFinished(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice 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 electNewAlderman(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 ch.sahits.game.openpatrician.model.DisplayMessage 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 handleAldermansTask(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice office)
private void updateAldermanTasks(ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice 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)
boolean isHumanPlayer(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.IAldermanTask task)
void updateTreasuryWeekly(ch.sahits.game.openpatrician.model.city.cityhall.ICityHall cityHall)
public void checkPirateKilledAldermanTask(ShipAttackEvent event)
event - private ch.sahits.game.openpatrician.model.city.cityhall.IAldermanOffice getAldermanOffice()
Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.