public class RasterableModel extends TraitModel implements Rasterable
The ObjectGame
owner must have the following Trait
:
MAX_RASTERS, MAX_RASTERS_M, MAX_RASTERS_R
Constructor and Description |
---|
RasterableModel(SetupSurfaceRastered setup,
int tileHeight)
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.
|
boolean |
isRastered()
Check if raster is activated.
|
void |
prepare(ObjectGame owner,
Services services)
Prepare the trait.
|
void |
render(Graphic g) |
void |
update(double extrp) |
getOwner
public RasterableModel(SetupSurfaceRastered setup, int tileHeight)
setup
- The setup reference.tileHeight
- The tile height value (must be strictly positive).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 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 boolean isRastered()
Rasterable
isRastered
in interface Rasterable
true
if rastered, false
else.Copyright © 2016 Byron 3D Games Studio. All rights reserved.