public class LauncherModel extends FeatureModel implements Launcher
Constructor and Description |
---|
LauncherModel(Services services,
Setup setup)
Create a launcher model.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(LaunchableListener listener)
Add a launchable listener.
|
void |
addListener(LauncherListener listener)
Add a launcher listener.
|
void |
checkListener(Object listener)
Check object interface listening and add them automatically.
|
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 |
prepare(FeatureProvider provider)
Prepare the feature.
|
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.
|
void |
update(double extrp) |
getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFeature, getFeatures, getFeaturesType, hasFeature
public LauncherModel(Services services, Setup setup)
The Services
must provide the following services:
The Featurable
must have:
The Setup
must provide a valid LauncherConfig
.
If the Featurable
is a LauncherListener
, it will automatically
addListener(LauncherListener)
on it.
services
- The services reference.setup
- The setup reference.public void prepare(FeatureProvider provider)
Feature
Featurable.addFeature(Feature)
or
Featurable.addFeatureAndGet(Feature)
.prepare
in interface Feature
prepare
in class FeatureModel
provider
- The owner reference.public void checkListener(Object listener)
FeatureModel
Feature
provide listeners, this will
allow to add them automatically.
Does nothing by default.
checkListener
in interface Feature
checkListener
in class FeatureModel
listener
- The listener to check.public void addListener(LauncherListener listener)
Launcher
addListener
in interface Launcher
listener
- The launcher listener to add.public void addListener(LaunchableListener listener)
Launcher
addListener
in interface Launcher
listener
- The launchable listener to add.public boolean fire()
Launcher
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.public boolean fire(Direction initial)
Launcher
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.public boolean fire(Localizable target)
Launcher
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.public boolean fire(Direction initial, Localizable target)
Launcher
LauncherListener
will be notified with
LauncherListener.notifyFired()
first, and LaunchableListener.notifyFired(Launchable)
for each
launch.public void setOffset(int x, int y)
Launcher
Launchable
starting position on fire.public void setLevel(int level)
Launcher
public void setRate(long rate)
Launcher
public int getOffsetX()
Launcher
getOffsetX
in interface Launcher
public int getOffsetY()
Launcher
getOffsetY
in interface Launcher
public int getLevel()
Launcher
Copyright © 2017 Byron 3D Games Studio. All rights reserved.