public class RasterableModel extends FeatureModel implements Rasterable, Recyclable
Constructor and Description |
---|
RasterableModel(Services services,
SetupSurfaceRastered setup)
Create a rasterable model.
|
Modifier and Type | Method and Description |
---|---|
SpriteAnimated |
getRasterAnim(int rasterIndex)
Get raster animation from raster index.
|
int |
getRasterIndex(double y)
Get raster index from location.
|
void |
prepare(FeatureProvider provider)
Prepare the feature.
|
void |
recycle()
Recycle feature, to make it ready for reuse.
|
void |
render(Graphic g) |
void |
setOrigin(Origin origin)
Set the origin location type, related to surface area.
|
void |
update(double extrp) |
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener
getFeature, getFeatures, getFeaturesType, hasFeature
public RasterableModel(Services services, SetupSurfaceRastered setup)
The Services
must provide:
The Featurable
must have:
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 render(Graphic g)
render
in interface Renderable
public int getRasterIndex(double y)
Rasterable
getRasterIndex
in interface Rasterable
y
- The current y location.public SpriteAnimated getRasterAnim(int rasterIndex)
Rasterable
getRasterAnim
in interface Rasterable
rasterIndex
- The raster index (positive).public void setOrigin(Origin origin)
Rasterable
setOrigin
in interface Rasterable
origin
- The origin typepublic final void recycle()
Recyclable
recycle
in interface Recyclable
Copyright © 2017 Byron 3D Games Studio. All rights reserved.