|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.strategy.ability.AbstractExtractAbility<TTile,TSkill,TAttr,TRsc>
TTile
- tile type used.TSkill
- skill type used.TAttr
- attributes type used.public abstract class AbstractExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
This is the main implementation of the extract ability. This object can be used by any kind of unit which will receive the ability of extraction.
Field Summary | |
---|---|
protected int |
rscX
Ressources location in tile. |
protected int |
rscY
Ressources location in tile. |
protected int |
whsX
Warehouse location in tile. |
protected int |
whsY
Warehouse location in tile. |
Constructor Summary | |
---|---|
AbstractExtractAbility(AbstractUnit<TTile,TSkill,TAttr> worker)
Create a new extract ability. |
Method Summary | |
---|---|
abstract boolean |
canCarry()
Action called when entry is going to carry. |
abstract boolean |
canExtract()
Action called when entry is going to extract. |
TRsc |
getRessourceType()
Get ressource type. |
boolean |
hasRessources()
Check if worker has a ressources location. |
boolean |
hasWarehouse()
Check if worker has a warehouse location. |
boolean |
isExtracting()
Check if worker is currently working on extraction. |
abstract void |
onCarried()
Action called when entry carried ressources. |
abstract void |
onCarry()
Action called when entry is carrying ressources. |
abstract void |
onDropOff()
Action called when entry is back to the warehouse. |
abstract void |
onDroppedOff()
Action called when entry has dropped ressources to warehouse. |
abstract void |
onExtract()
Action called when entry is extracting ressources. |
abstract void |
onExtracted()
Action called when extraction is done. |
abstract void |
onGotoRessource()
Action called when entry is moving until ressources. |
void |
setDropOffTime(long time)
Set time to drop off ressource inside the warehouse. |
void |
setExtractionTime(long time)
Set time for extraction (in millisecond). |
void |
setRessourceLocation(int tx,
int ty)
Set ressource location (as a tile). |
void |
setRessourceType(TRsc type)
Set ressource type to extract. |
void |
setWarehouse(int tx,
int ty)
Set storage point (where will be stored ressources). |
void |
startExtraction()
Start extraction. |
void |
stopExtraction()
Stop any action related to extration. |
void |
updateExtraction(float extrp)
Update extraction (extract and go back). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int rscX
protected int rscY
protected int whsX
protected int whsY
Constructor Detail |
---|
public AbstractExtractAbility(AbstractUnit<TTile,TSkill,TAttr> worker)
worker
- concerned worker reference.Method Detail |
---|
public void updateExtraction(float extrp)
ExtractAbility
updateExtraction
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
extrp
- extrapolation value.public void setRessourceLocation(int tx, int ty)
ExtractAbility
setRessourceLocation
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
tx
- map tile x.ty
- map tile y.public void setWarehouse(int tx, int ty)
ExtractAbility
setWarehouse
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
tx
- map tile x.ty
- map tile y.public boolean hasRessources()
ExtractAbility
hasRessources
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public boolean hasWarehouse()
ExtractAbility
hasWarehouse
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public void setExtractionTime(long time)
ExtractAbility
setExtractionTime
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
time
- extraction time in millisecond.public void setDropOffTime(long time)
ExtractAbility
setDropOffTime
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
time
- drop off time in millisecond.public void startExtraction()
ExtractAbility
startExtraction
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public boolean isExtracting()
ExtractAbility
isExtracting
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public void stopExtraction()
ExtractAbility
stopExtraction
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public void setRessourceType(TRsc type)
ExtractAbility
setRessourceType
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
type
- ressource type.public TRsc getRessourceType()
ExtractAbility
getRessourceType
in interface ExtractAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes,TRsc>
public abstract boolean canExtract()
public abstract boolean canCarry()
public abstract void onGotoRessource()
public abstract void onExtract()
public abstract void onExtracted()
public abstract void onCarry()
public abstract void onCarried()
public abstract void onDropOff()
public abstract void onDroppedOff()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |