T
- The enum containing all projectiles type.E
- The entity type used.E2
- The entity attacker type used.P
- The projectile type used.public abstract class LauncherProjectileGame<T extends java.lang.Enum<T> & ObjectType,E extends EntityGame,E2 extends Surface,P extends ProjectileGame<E,E2>> extends ObjectGame
Constructor and Description |
---|
LauncherProjectileGame(SetupGame setup,
FactoryObjectGame<T,? extends SetupSurfaceGame,P> factory,
HandlerProjectileGame<E,P> handler)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canHitOnlyTarget()
Get the hit target only state.
|
int |
getRatePercent()
Get rate shoot percent.
|
boolean |
launch()
Start shoot.
|
boolean |
launch(E target)
Start shoot.
|
void |
setAdaptative(boolean adaptative)
Set the adaptative flag.
|
void |
setCanHitTargetOnly(boolean hitTargetOnly)
Set the hit target properties.
|
void |
setOffsetX(int x)
Set global starting projectile horizontal offset.
|
void |
setOffsetY(int y)
Set global starting projectile vertical offset.
|
void |
setOwner(E2 owner)
Set the projectile owner.
|
void |
setRate(int rate)
Set shoot rate (in millisecond).
|
destroy, getDataAnimation, getDataBoolean, getDataCollision, getDataDouble, getDataInteger, getDataRoot, getDataString, getId, isDestroyed, loadData
public final Alterable level
public LauncherProjectileGame(SetupGame setup, FactoryObjectGame<T,? extends SetupSurfaceGame,P> factory, HandlerProjectileGame<E,P> handler)
setup
- The setup reference.factory
- The projectiles factory.handler
- The projectiles handler.public boolean launch()
true
if shot, false
else.public boolean launch(E target)
target
- The target.true
if shot, false
else.public void setOwner(E2 owner)
owner
- The entity owner.public void setCanHitTargetOnly(boolean hitTargetOnly)
hitTargetOnly
- true
to make the projectile hit only the target, false
to allows
other hits.public void setAdaptative(boolean adaptative)
adaptative
- true
to anticipate target movement, false
else.public void setRate(int rate)
rate
- shoot rate.public void setOffsetX(int x)
x
- horizontal starting shoot offset.public void setOffsetY(int y)
y
- vertical starting shoot offset.public int getRatePercent()
public boolean canHitOnlyTarget()
true
if can hit only the target, false
else.