|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.BuildQueue<T>
public class BuildQueue<T extends BuildableType>
| Nested Class Summary | |
|---|---|
static class |
BuildQueue.CompletionAction
|
| Field Summary | |
|---|---|
private java.util.List<T> |
buildQueue
A list of Buildable items. |
private Colony |
colony
|
private BuildQueue.CompletionAction |
completionAction
What to do when an item has been completed. |
private int |
priority
|
| Fields inherited from interface net.sf.freecol.common.model.Consumer |
|---|
BUILDING_PRIORITY, COLONY_PRIORITY, COMPARATOR, POPULATION_PRIORITY, UNIT_PRIORITY |
| Constructor Summary | |
|---|---|
BuildQueue(Colony colony,
BuildQueue.CompletionAction action,
int priority,
T... items)
|
|
| Method Summary | |
|---|---|
void |
add(T buildable)
|
void |
clear()
|
boolean |
consumes(GoodsType goodsType)
Returns true if this Consumer consumes the given GoodsType. |
BuildQueue.CompletionAction |
getCompletionAction()
Get the CompletionAction value. |
java.util.List<AbstractGoods> |
getConsumedGoods()
Returns a list of GoodsTypes this Consumer consumes. |
T |
getCurrentlyBuilding()
Returns the type of building currently being built. |
java.util.Set<Modifier> |
getModifierSet(java.lang.String id)
Returns the modifier set with the given id. |
int |
getPriority()
The priority of this Consumer. |
ProductionInfo |
getProductionInfo(java.util.List<AbstractGoods> input)
Return the ProductionInfo for this BuildQueue. |
java.util.List<T> |
getValues()
|
boolean |
hasAbility(java.lang.String id)
Returns whether the consumer has the ability with the given id. |
boolean |
isEmpty()
|
void |
remove(int index)
|
void |
setCompletionAction(BuildQueue.CompletionAction newCompletionAction)
Set the CompletionAction value. |
void |
setCurrentlyBuilding(T buildable)
Sets the current type of buildable to be built and if it is a building insist that there is only one in the queue. |
void |
setValues(java.util.List<T> values)
|
int |
size()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.List<T extends BuildableType> buildQueue
private BuildQueue.CompletionAction completionAction
private int priority
private Colony colony
| Constructor Detail |
|---|
public BuildQueue(Colony colony,
BuildQueue.CompletionAction action,
int priority,
T... items)
| Method Detail |
|---|
public T getCurrentlyBuilding()
public void setCurrentlyBuilding(T buildable)
buildable - The T to build.public void clear()
public void add(T buildable)
public java.util.List<T> getValues()
public void setValues(java.util.List<T> values)
public void remove(int index)
public int size()
public boolean isEmpty()
public final BuildQueue.CompletionAction getCompletionAction()
CompletionAction value.
CompletionAction valuepublic final void setCompletionAction(BuildQueue.CompletionAction newCompletionAction)
CompletionAction value.
newCompletionAction - The new CompletionAction value.public boolean consumes(GoodsType goodsType)
goodsType - a GoodsType value
boolean valuepublic java.util.List<AbstractGoods> getConsumedGoods()
getConsumedGoods in interface ConsumerList valuepublic ProductionInfo getProductionInfo(java.util.List<AbstractGoods> input)
ProductionInfo for this BuildQueue.
input - the goods available
ProductionInfo for this BuildQueuepublic int getPriority()
getPriority in interface Consumerint valuepublic boolean hasAbility(java.lang.String id)
hasAbility in interface Consumerid - a String value
boolean valuepublic java.util.Set<Modifier> getModifierSet(java.lang.String id)
getModifierSet in interface Consumerid - a String value
boolean valuepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||