|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.strategy.ability.AbstractBuilderAbility<TTile,TSkill,TAttr>
TTile
- tile type used.TSkill
- skill type used.TAttr
- attributes type used.public abstract class AbstractBuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
This is the main implementation of the builder ability. This object can be used by any kind of unit which will receive the ability of building.
Nested Class Summary | |
---|---|
protected class |
AbstractBuilderAbility.Constructible
|
Field Summary | |
---|---|
protected java.util.Queue<AbstractBuilderAbility.Constructible> |
constructions
|
protected AbstractBuilderAbility.Constructible |
cur
|
protected AbstractEntryHandler<TTile,TSkill,TAttr> |
entrys
Entry handler reference. |
Constructor Summary | |
---|---|
AbstractBuilderAbility(AbstractUnit<TTile,TSkill,TAttr> builder,
AbstractEntryHandler<TTile,TSkill,TAttr> handler)
Create a new attacker ability. |
Method Summary | |
---|---|
void |
buildAt(int tx,
int ty,
java.lang.String building,
int tw,
int th,
int time)
Define a construction plan, set the action to 'build', and move to the destination. |
abstract boolean |
canBuild(AbstractBuilderAbility.Constructible constructible)
Check if this constructible can be built. |
abstract void |
constructionRefused(AbstractBuilderAbility.Constructible constructible)
Called when construction is refused. |
AbstractBuilding<TTile,TSkill,TAttr> |
getBuilding()
Get building which will be built. |
abstract AbstractBuilding<TTile,TSkill,TAttr> |
getBuildingToBuild(java.lang.String name)
|
boolean |
isConstructing()
Check if builder is currently constructing. |
void |
onConstructed(AbstractBuilding<TTile,TSkill,TAttr> building)
Called by the building when construction is done. |
void |
startConstruction(java.lang.String name)
|
void |
stopBuild()
Stop any action, reset all states. |
void |
updateConstruction(float extrp)
Update construction routine. |
abstract void |
willBuild(java.lang.String name)
Building name going to be built. |
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
protected final java.util.Queue<AbstractBuilderAbility.Constructible> constructions
protected AbstractBuilderAbility.Constructible cur
Constructor Detail |
---|
public AbstractBuilderAbility(AbstractUnit<TTile,TSkill,TAttr> builder, AbstractEntryHandler<TTile,TSkill,TAttr> handler)
builder
- concerned builder reference.handler
- entry handler reference.Method Detail |
---|
public void buildAt(int tx, int ty, java.lang.String building, int tw, int th, int time)
BuilderAbility
buildAt
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
tx
- building construction location x.ty
- building construction location y.building
- building to build.tw
- building width.th
- building height.time
- construction time.public void updateConstruction(float extrp)
BuilderAbility
updateConstruction
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
extrp
- extrapolation value.public abstract AbstractBuilding<TTile,TSkill,TAttr> getBuildingToBuild(java.lang.String name)
public void startConstruction(java.lang.String name)
public abstract void constructionRefused(AbstractBuilderAbility.Constructible constructible)
constructible
- construction refused.public abstract boolean canBuild(AbstractBuilderAbility.Constructible constructible)
constructible
- constructible to construct.
public boolean isConstructing()
BuilderAbility
isConstructing
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void stopBuild()
BuilderAbility
stopBuild
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public AbstractBuilding<TTile,TSkill,TAttr> getBuilding()
BuilderAbility
getBuilding
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void onConstructed(AbstractBuilding<TTile,TSkill,TAttr> building)
BuilderAbility
onConstructed
in interface BuilderAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
building
- building built.public abstract void willBuild(java.lang.String name)
name
- building name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |