public interface Launcher extends Refreshable
Launchable
at a defined rate from a defined location using a specified
vector.Launchable
Modifier and Type | Method and Description |
---|---|
void |
addListener(LaunchableListener listener)
Add a launchable listener.
|
void |
addListener(LauncherListener listener)
Add a launcher listener.
|
boolean |
fire()
Fire with the specified configuration.
|
boolean |
fire(Direction initial)
Fire with the specified configuration.
|
boolean |
fire(Direction initial,
Localizable target)
Fire with the specified configuration.
|
boolean |
fire(Localizable target)
Fire with the specified configuration.
|
int |
getLevel()
Get the current level.
|
int |
getOffsetX()
Get the horizontal offset.
|
int |
getOffsetY()
Get the vertical offset.
|
long |
getRate()
Get the fire rate.
|
void |
setLevel(int level)
Set the level used.
|
void |
setOffset(int x,
int y)
Set the launcher position offset.
|
void |
setRate(long rate)
Set the fire rate.
|
checkListener, prepare
getFeature, getFeatures, getFeaturesType, hasFeature
void addListener(LauncherListener listener)
listener
- The launcher listener to add.void addListener(LaunchableListener listener)
listener
- The launchable listener to add.boolean fire()
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.true
if fired, false
else.LionEngineException
- If the fired object is not a Launchable
.boolean fire(Direction initial)
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.initial
- The fire initial speed, used to transfer the initial force on launch.true
if fired, false
else.LionEngineException
- If the fired object is not a Launchable
.boolean fire(Localizable target)
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.target
- The launch target.true
if fired, false
else.LionEngineException
- If the fired object is not a Launchable
.boolean fire(Direction initial, Localizable target)
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.initial
- The fire initial speed, used to transfer the initial force on launch.target
- The launch target.true
if fired, false
else.LionEngineException
- If the fired object is not a Launchable
.void setOffset(int x, int y)
Launchable
starting position on fire.x
- The horizontal offset.y
- The vertical offset.void setLevel(int level)
level
- The level used (must be superior or equal to 0).LionEngineException
- If wrong argument.void setRate(long rate)
rate
- The fire rate in millisecond.int getOffsetX()
int getOffsetY()
int getLevel()
long getRate()
Copyright © 2017 Byron 3D Games Studio. All rights reserved.