public class IdentifiableModel extends FeatureModel implements Identifiable, Recyclable
Constructor and Description |
---|
IdentifiableModel()
Create the identifiable with a unique ID.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(IdentifiableListener listener)
Add an identifiable listener.
|
void |
destroy()
Declare as removable.
|
Integer |
getId()
Get the ID (
null will be returned once removed after a call to Identifiable.destroy() ). |
void |
notifyDestroyed()
Notify effective destruction, and allow to recycle destroyed ID.
|
void |
recycle()
Recycle feature, to make it ready for reuse.
|
void |
removeListener(IdentifiableListener listener)
Remove an identifiable listener.
|
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature, prepare
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener, prepare
getFeature, getFeatures, getFeaturesType, hasFeature
public IdentifiableModel()
LionEngineException
- If no free ID available.public void addListener(IdentifiableListener listener)
Identifiable
addListener
in interface Identifiable
listener
- The listener reference.public void removeListener(IdentifiableListener listener)
Identifiable
removeListener
in interface Identifiable
listener
- The listener reference.public Integer getId()
Identifiable
null
will be returned once removed after a call to Identifiable.destroy()
).getId
in interface Identifiable
public void destroy()
Identifiable
Identifiable.notifyDestroyed()
should be called when recycle can be performed.destroy
in interface Identifiable
public void notifyDestroyed()
Identifiable
Identifiable.getId()
will return
null
.
Called by the identifiable handler after a call to Identifiable.destroy()
.notifyDestroyed
in interface Identifiable
public void recycle()
Recyclable
recycle
in interface Recyclable
Copyright © 2017 Byron 3D Games Studio. All rights reserved.