Class ContractBrokers
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.land.city.ContractBrokers
-
- All Implemented Interfaces:
ch.sahits.game.openpatrician.model.people.IContractBrokers
@Component public class ContractBrokers extends java.lang.Object implements ch.sahits.game.openpatrician.model.people.IContractBrokersList of all contract brokers- Author:
- Andi Hotz, (c) Sahits GmbH, 2018 Created on Apr 30, 2018
-
-
Constructor Summary
Constructors Constructor Description ContractBrokers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ch.sahits.game.openpatrician.model.people.IContractBroker broker, ch.sahits.game.openpatrician.model.city.ICity city)voidassignPlayer(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.people.IContractBroker broker, java.time.LocalDateTime deadline)Assign a player to a contract broker.java.util.Optional<ch.sahits.game.openpatrician.model.people.IContractBroker>findContractBroker(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IPlayer player)booleanhasContractBroker(ch.sahits.game.openpatrician.model.city.ICity city)voidremove(ch.sahits.game.openpatrician.model.people.IContractBroker broker)Remove the connections matching a specific broker.voidremovePastDeadline(ch.sahits.game.event.data.PeriodicalDailyUpdate event)Daily checking if the deadline has passed.
-
-
-
Method Detail
-
add
public void add(ch.sahits.game.openpatrician.model.people.IContractBroker broker, ch.sahits.game.openpatrician.model.city.ICity city)- Specified by:
addin interfacech.sahits.game.openpatrician.model.people.IContractBrokers
-
assignPlayer
public void assignPlayer(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.people.IContractBroker broker, java.time.LocalDateTime deadline)Assign a player to a contract broker.- Parameters:
player- to be assignedbroker- to whom the player is assigned.deadline- until when the wares have to be delivered.
-
remove
public void remove(ch.sahits.game.openpatrician.model.people.IContractBroker broker)
Remove the connections matching a specific broker.- Parameters:
broker- to be removed.
-
removePastDeadline
public void removePastDeadline(ch.sahits.game.event.data.PeriodicalDailyUpdate event)
Daily checking if the deadline has passed.- Parameters:
event-
-
findContractBroker
public java.util.Optional<ch.sahits.game.openpatrician.model.people.IContractBroker> findContractBroker(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IPlayer player)- Specified by:
findContractBrokerin interfacech.sahits.game.openpatrician.model.people.IContractBrokers
-
hasContractBroker
public boolean hasContractBroker(ch.sahits.game.openpatrician.model.city.ICity city)
- Specified by:
hasContractBrokerin interfacech.sahits.game.openpatrician.model.people.IContractBrokers
-
-