Class ContractBrookerState
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.people.impl.BaseTradePerson
-
- ch.sahits.game.openpatrician.model.people.impl.ContractBrookerState
-
- All Implemented Interfaces:
IContractBroker
,IPerson
,ITradePerson
public class ContractBrookerState extends BaseTradePerson implements IContractBroker
Implementation of a contract brooker. Every city can have a contract brooker and is referenced through it's TavernEngine.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 20, 2013
-
-
Field Summary
Fields Modifier and Type Field Description private AmountablePrice<IWare>
amountAndPrice
private int
deliveredAmount
private static RandomNameLoader
firstNameLoader
private static RandomNameLoader
lastNameLoader
private java.lang.String
name
private IWare
ware
-
Constructor Summary
Constructors Constructor Description ContractBrookerState(AmountablePrice<IWare> amountAndPrice, IWare ware)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deliver(int amount)
Deliver a specified amount.private void
update()
Generate a name of the broker.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.IContractBroker
getAmountAndPrice, getDeliveredAmount, getName, getWare, setName
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.ITradePerson
getAmount, getAvgPricePerItem, setAmount, setAvgPricePerItem, setWare
-
-
-
-
Field Detail
-
name
private java.lang.String name
-
amountAndPrice
private final AmountablePrice<IWare> amountAndPrice
-
ware
private final IWare ware
-
deliveredAmount
private int deliveredAmount
-
firstNameLoader
private static RandomNameLoader firstNameLoader
-
lastNameLoader
private static RandomNameLoader lastNameLoader
-
-
Constructor Detail
-
ContractBrookerState
public ContractBrookerState(AmountablePrice<IWare> amountAndPrice, IWare ware)
-
-
Method Detail
-
update
@PostConstruct private void update()
Generate a name of the broker.
-
deliver
public void deliver(int amount)
Description copied from interface:IContractBroker
Deliver a specified amount.- Specified by:
deliver
in interfaceIContractBroker
- Parameters:
amount
- deliver the amount of ware.
-
-