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 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 intgetAmount()Amount of the ware that is to be delivered.intgetAvgPricePerItem()Get the price of a single itemIWaregetWare()The ware the broker is to be delivered.voidsetAmount(int amount)Set the amount of the tradevoidsetAvgPricePerItem(int avgPricePerItem)Set the price per itemvoidsetWare(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
-
-
-
-
Method Detail
-
getWare
public IWare getWare()
Description copied from interface:ITradePersonThe ware the broker is to be delivered.- Specified by:
getWarein interfaceITradePerson- Returns:
- ware the trader whiches to aquire.
-
setWare
public void setWare(IWare ware)
Description copied from interface:ITradePersonSet the ware for the trade.- Specified by:
setWarein interfaceITradePerson- Parameters:
ware- of the trade
-
getAmount
public int getAmount()
Description copied from interface:ITradePersonAmount of the ware that is to be delivered. The amount is in the ware specific quantity.- Specified by:
getAmountin interfaceITradePerson- Returns:
- amount of the ware
-
getAvgPricePerItem
public int getAvgPricePerItem()
Description copied from interface:ITradePersonGet the price of a single item- Specified by:
getAvgPricePerItemin interfaceITradePerson- Returns:
- average price per item.
-
setAmount
public void setAmount(int amount)
Description copied from interface:ITradePersonSet the amount of the trade- Specified by:
setAmountin interfaceITradePerson- Parameters:
amount- of the ware to be traded
-
setAvgPricePerItem
public void setAvgPricePerItem(int avgPricePerItem)
Description copied from interface:ITradePersonSet the price per item- Specified by:
setAvgPricePerItemin interfaceITradePerson- Parameters:
avgPricePerItem- average price per item of the ware.
-
-