public class FeaturableModel extends Object implements Featurable
Constructor and Description |
---|
FeaturableModel()
Create model.
|
FeaturableModel(Services services,
Setup setup)
Create model.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeature(Feature feature)
Add a feature.
|
<T extends Feature> |
addFeatureAndGet(T feature)
Add a feature and retrieve it.
|
void |
checkListener(Object listener)
Check object interface listening and add them automatically.
|
static void |
clearCache()
Clear classes cache.
|
<C extends Feature> |
getFeature(Class<C> feature)
Get a feature instance from its type.
|
Iterable<Feature> |
getFeatures()
Get the supported features.
|
Iterable<Class<? extends Feature>> |
getFeaturesType()
Get the supported features type.
|
Media |
getMedia()
Get the associated media.
|
boolean |
hasFeature(Class<? extends Feature> feature)
Check a feature existence from its type.
|
public static void clearCache()
public void checkListener(Object listener)
Feature
provide listeners, this will
allow to add them automatically.
Does nothing by default.
checkListener
in interface Featurable
listener
- The listener to check.public final void addFeature(Feature feature)
Featurable
addFeature
in interface Featurable
feature
- The feature to add.public final <T extends Feature> T addFeatureAndGet(T feature)
Featurable
FeaturableConfig.NODE_FEATURE
nodes.addFeatureAndGet
in interface Featurable
T
- The feature type.feature
- The feature to add.public final <C extends Feature> C getFeature(Class<C> feature)
FeatureProvider
Feature
is not prepared.getFeature
in interface FeatureProvider
C
- The custom feature type.feature
- The feature type.public final Iterable<Feature> getFeatures()
FeatureProvider
getFeatures
in interface FeatureProvider
public final Iterable<Class<? extends Feature>> getFeaturesType()
FeatureProvider
getFeaturesType
in interface FeatureProvider
public final boolean hasFeature(Class<? extends Feature> feature)
FeatureProvider
hasFeature
in interface FeatureProvider
feature
- The feature type.true
if feature exists, false
else.public Media getMedia()
Featurable
getMedia
in interface Featurable
null
if none.Copyright © 2017 Byron 3D Games Studio. All rights reserved.