public class TileCollidableModel extends FeatureModel implements TileCollidable, Recyclable
Constructor and Description |
---|
TileCollidableModel(Services services,
Setup setup)
Create a tile collidable model.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(TileCollidableListener listener)
Add a tile collision listener.
|
void |
checkListener(Object listener)
Check object interface listening and add them automatically.
|
Collection<CollisionCategory> |
getCategories()
Get the collision tile category used.
|
void |
prepare(FeatureProvider provider)
Prepare the feature.
|
void |
recycle()
Recycle feature, to make it ready for reuse.
|
void |
removeListener(TileCollidableListener listener)
Remove a tile collision listener.
|
void |
setEnabled(boolean enabled)
Set the collision tile enabled flag.
|
void |
update(double extrp) |
getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFeature, getFeatures, getFeaturesType, hasFeature
public TileCollidableModel(Services services, Setup setup)
The Services
must provide:
The Featurable
must have:
The Setup
must provide a valid CollisionCategoryConfig
.
If the Featurable
is a TileCollidableListener
, it will automatically
addListener(TileCollidableListener)
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(TileCollidableListener listener)
TileCollidable
addListener
in interface TileCollidable
listener
- The tile collision listener to add.public void removeListener(TileCollidableListener listener)
TileCollidable
removeListener
in interface TileCollidable
listener
- The tile collision listener to remove.public void setEnabled(boolean enabled)
TileCollidable
setEnabled
in interface TileCollidable
enabled
- true
to enable collision checking, false
else.public Collection<CollisionCategory> getCategories()
TileCollidable
getCategories
in interface TileCollidable
public final void recycle()
Recyclable
recycle
in interface Recyclable
Copyright © 2017 Byron 3D Games Studio. All rights reserved.