Class TraderState
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.people.impl.BaseTavernPerson
-
- ch.sahits.game.openpatrician.model.people.impl.TraderState
-
- All Implemented Interfaces:
IPerson
,ITavernPerson
,ITradePerson
,ITrader
public class TraderState extends BaseTavernPerson implements ITrader
Implementation of a trader. Every city can have a trader 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 BaseTradePerson
tradePerson
-
Fields inherited from class ch.sahits.game.openpatrician.model.people.impl.BaseTavernPerson
date
-
-
Constructor Summary
Constructors Constructor Description TraderState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAmount()
Amount of the ware that is to be delivered.int
getAvgPricePerItem()
Get the price of a single itemIWare
getWare()
The ware the broker is to be delivered.void
setAmount(int amount)
Set the amount of the tradevoid
setAvgPricePerItem(int avgPricePerItem)
Set the price per itemvoid
setWare(IWare ware)
Set the ware for the trade.-
Methods inherited from class ch.sahits.game.openpatrician.model.people.impl.BaseTavernPerson
arrive, getMaxDaysAbsent, getMaxDaysPresent, getNumberOfDaysSinceArrival, isPresent, isPresentProperty, leave
-
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.ITavernPerson
arrive, getArrivalDate, getMaxDaysAbsent, getMaxDaysPresent, getNumberOfDaysSinceArrival, isPresent, isPresentProperty, leave, setCity
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.ITrader
getTradePerson
-
-
-
-
Field Detail
-
tradePerson
@Autowired @Qualifier("baseTradePerson") private BaseTradePerson tradePerson
-
-
Method Detail
-
getWare
public IWare getWare()
Description copied from interface:ITradePerson
The ware the broker is to be delivered.- Specified by:
getWare
in interfaceITradePerson
- Returns:
- ware the trader whiches to aquire.
-
setWare
public void setWare(IWare ware)
Description copied from interface:ITradePerson
Set the ware for the trade.- Specified by:
setWare
in interfaceITradePerson
- Parameters:
ware
- of the trade
-
getAmount
public int getAmount()
Description copied from interface:ITradePerson
Amount of the ware that is to be delivered. The amount is in the ware specific quantity.- Specified by:
getAmount
in interfaceITradePerson
- Returns:
- amount of the ware
-
getAvgPricePerItem
public int getAvgPricePerItem()
Description copied from interface:ITradePerson
Get the price of a single item- Specified by:
getAvgPricePerItem
in interfaceITradePerson
- Returns:
- average price per item.
-
setAmount
public void setAmount(int amount)
Description copied from interface:ITradePerson
Set the amount of the trade- Specified by:
setAmount
in interfaceITradePerson
- Parameters:
amount
- of the ware to be traded
-
setAvgPricePerItem
public void setAvgPricePerItem(int avgPricePerItem)
Description copied from interface:ITradePerson
Set the price per item- Specified by:
setAvgPricePerItem
in interfaceITradePerson
- Parameters:
avgPricePerItem
- average price per item of the ware.
-
-