public class ProducibleModel extends TraitModel implements Producible
The ObjectGame
owner must provide a valid Configurer
compatible
with ProducibleConfig
.
If the ObjectGame
is a ProducibleListener
, it will automatically
addListener(ProducibleListener)
on it.
Constructor and Description |
---|
ProducibleModel()
Create a producible and load its configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProducibleListener listener)
Add a producible listener.
|
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(ObjectGame owner,
Services services)
Prepare the trait.
|
void |
setLocation(double x,
double y)
Set the production location.
|
getOwner
public ProducibleModel()
public void prepare(ObjectGame owner, Services services)
Trait
prepare
in interface Trait
prepare
in class TraitModel
owner
- The owner reference.services
- The services reference.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
Copyright © 2016 Byron 3D Games Studio. All rights reserved.