|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.impl.WareHolding
public class WareHolding
This class represents an entity that can hold wares which can be moved
| Field Summary | |
|---|---|
(package private) HashMap<IWare,AmountablePrice> |
wares
Store the amount of wares in the city in the ware specific sizes |
| Constructor Summary | |
|---|---|
WareHolding()
|
|
| Method Summary | |
|---|---|
protected void |
addNewWare(IWare ware,
int amount)
Add a new ware to the wares list |
protected int |
computeAVGPrice(IWare ware,
int amount)
Compute the average price for ware that is to be purchased in the specified amount. |
protected boolean |
containsWare(IWare ware)
Check if there is an amountable object for this ware |
AmountablePrice |
getWare(IWare ware)
Retrieve the AmountablePrice of the ware as it is stored in the
holding |
int |
move(IWare ware,
int amount,
IPlayer player)
Move ware into this holding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final HashMap<IWare,AmountablePrice> wares
| Constructor Detail |
|---|
public WareHolding()
| Method Detail |
|---|
protected void addNewWare(IWare ware,
int amount)
ware - public AmountablePrice getWare(IWare ware)
AmountablePrice of the ware as it is stored in the
holding
ware - to be retrieved
public int move(IWare ware,
int amount,
IPlayer player)
ware - to be movedamount - of the ware that is movedplayer - that initiates the moving, may be null, e.g. if the moving is initiated by a city
protected final boolean containsWare(IWare ware)
ware -
protected int computeAVGPrice(IWare ware,
int amount)
getWare(IWare).
Subclasses may override this method.
ware - for which the average price is to be computedamount - amount that is bought
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||