public class ProducibleModel extends FeatureModel implements Producible, Recyclable
Constructor and Description |
---|
ProducibleModel(Setup setup)
Create a producible and load its configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProducibleListener listener)
Add a producible listener.
|
void |
checkListener(Object listener)
Check object interface listening and add them automatically.
|
int |
getHeight() |
Collection<ProducibleListener> |
getListeners()
Get the listeners reference.
|
Media |
getMedia()
Get the media representing the producible.
|
int |
getSteps()
Get the production steps number.
|
int |
getWidth() |
double |
getX() |
double |
getY() |
void |
prepare(FeatureProvider provider)
Prepare the feature.
|
void |
recycle()
Recycle feature, to make it ready for reuse.
|
void |
setLocation(double x,
double y)
Set the production location.
|
getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFeature, getFeatures, getFeaturesType, hasFeature
public ProducibleModel(Setup setup)
The Setup
must provide a valid ProducibleConfig
.
If the Featurable
is a ProducibleListener
, it will automatically
addListener(ProducibleListener)
on it.
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(ProducibleListener listener)
Producible
addListener
in interface Producible
listener
- The producible listener to add.public Collection<ProducibleListener> getListeners()
Producible
getListeners
in interface Producible
public void setLocation(double x, double y)
Producible
setLocation
in interface Producible
x
- The horizontal location.y
- The vertical location.public double getX()
getX
in interface Localizable
public double getY()
getY
in interface Localizable
public Media getMedia()
Producible
getMedia
in interface Producible
public int getSteps()
Producible
getSteps
in interface Producible
public final void recycle()
Recyclable
recycle
in interface Recyclable
Copyright © 2017 Byron 3D Games Studio. All rights reserved.