|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.strategy.ability.AbstractProducerAbility<TTile,TSkill,TAttr>
TTile
- tile type used.TSkill
- skill type used.TAttr
- attributes type used.public abstract class AbstractProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
This is the main implementation of the producer ability. This object can be used by any kind of unit which will receive the ability of production. It also supports rally point (when unit is produced, it will reach this point).
Field Summary | |
---|---|
protected AbstractEntryHandler<TTile,TSkill,TAttr> |
entrys
Entry handler reference. |
Constructor Summary | |
---|---|
AbstractProducerAbility(AbstractBuilding<TTile,TSkill,TAttr> building,
AbstractEntryHandler<TTile,TSkill,TAttr> handler)
Create a new attacker ability. |
Method Summary | |
---|---|
void |
addToProductionQueue(java.lang.String name,
int time)
Add an element to the production queue. |
abstract boolean |
canBeProduced()
Condition to make production finished (entry exit from production). |
abstract boolean |
canProduce()
Condition to start production. |
java.lang.String |
getProducingElement()
Get name of current producing element. |
int |
getProductionProgress()
Get production progress in percent. |
int |
getQueueLength()
Get size of production queue. |
protected abstract AbstractUnit<TTile,TSkill,TAttr> |
getUnitToProduce(java.lang.String name)
Get unit to produce reference from its name. |
abstract void |
onCanNotProduce()
Action called when producer can't produce. |
abstract void |
onProduced(AbstractUnit<TTile,TSkill,TAttr> unit)
Action called when production is done. |
abstract void |
onProducing()
Action called on producing. |
void |
setRallyLocation(int tx,
int ty)
Rally location in tile. |
void |
stopProduction()
Stop any production. |
void |
updateProduction()
Update production routine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final AbstractEntryHandler<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes> entrys
Constructor Detail |
---|
public AbstractProducerAbility(AbstractBuilding<TTile,TSkill,TAttr> building, AbstractEntryHandler<TTile,TSkill,TAttr> handler)
building
- concerned building reference.handler
- entry handler reference.Method Detail |
---|
public void addToProductionQueue(java.lang.String name, int time)
ProducerAbility
addToProductionQueue
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
name
- entry name to produce.time
- production time.protected abstract AbstractUnit<TTile,TSkill,TAttr> getUnitToProduce(java.lang.String name)
name
- unit name.
public void updateProduction()
ProducerAbility
updateProduction
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void stopProduction()
ProducerAbility
stopProduction
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void setRallyLocation(int tx, int ty)
ProducerAbility
setRallyLocation
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
tx
- horizontal tile index.ty
- vertical tile index.public int getProductionProgress()
ProducerAbility
getProductionProgress
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public java.lang.String getProducingElement()
ProducerAbility
getProducingElement
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public int getQueueLength()
ProducerAbility
getQueueLength
in interface ProducerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public abstract boolean canProduce()
public abstract boolean canBeProduced()
public abstract void onCanNotProduce()
public abstract void onProducing()
public abstract void onProduced(AbstractUnit<TTile,TSkill,TAttr> unit)
unit
- unit produced.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |