public abstract class QuickEntity extends Object implements Entity, EngineHolder<CoreEngine>
Entity easily.
Implements all methods in order to override only "needed" methods and handels the following:
- Storing the parent node
- Storing the coreengine
- Storing a name (and setting it)| Modifier and Type | Field and Description |
|---|---|
protected boolean |
destroy |
protected CoreEngine |
engine |
protected String |
name |
static String |
NAME_UNTITLED_ENTITY |
protected Node |
parent |
| Constructor and Description |
|---|
QuickEntity()
Create an "Untitled Entity"
|
QuickEntity(String name)
Create a entity with a specifc name
|
| Modifier and Type | Method and Description |
|---|---|
void |
attached()
Called when an Entity gets attached to an scenegraph
|
Node |
boxed()
Returns a Node containing this Entity.
|
protected boolean |
canEqual(Object other) |
void |
destroy()
Marks this Entity to be no longer needed.
|
void |
destroy(boolean shouldbeDestroyed)
Set whether or not the resources assoc. with this Entity can be destroyed.
|
boolean |
equals(Object o) |
CoreEngine |
getEngine()
Retrieves the stored engine
|
String |
getName()
Should return the name of the Entits
|
Node |
getParent() |
Transform |
getTransform()
Should return the current transform of the Entity
|
int |
hashCode() |
boolean |
isDestroy() |
void |
removed()
Sets the parent to null.
|
void |
render(RenderEngine renderEngine)
Called on render, draw stuff here
|
void |
setDestroy(boolean destroy) |
void |
setEngine(CoreEngine engine)
Set the CoreEngine
|
void |
setName(String name) |
void |
setParent(Node parent)
Set the parent node
|
boolean |
shouldBeDestroyed()
If true, the Entity is no longer needed.
|
String |
toString() |
void |
update(float delta)
Trigger an update.
|
public static final String NAME_UNTITLED_ENTITY
protected Node parent
protected CoreEngine engine
protected String name
protected boolean destroy
public QuickEntity()
public QuickEntity(String name)
name - The namepublic void update(float delta)
Updatableupdate in interface Updatabledelta - The delta timeUpdatable.update(float)public void render(RenderEngine renderEngine)
Entityrender in interface EntityrenderEngine - The active renderEngine (caller)Entity.render(org.achtern.AchternEngine.core.rendering.RenderEngine)public void removed()
removed in interface EntityEntity.removed()public void attached()
Entitypublic void destroy()
RenderEngine for example could decide to delete the
resources for a given Entity from the graphics card's memory, etc.public void destroy(boolean shouldbeDestroyed)
public boolean shouldBeDestroyed()
shouldBeDestroyed in interface Entitydestroy()public Node boxed()
public Transform getTransform()
EntitygetTransform in interface EntityEntity.getTransform()@Generated(value="lombok") public Node getParent()
@Generated(value="lombok") public CoreEngine getEngine()
EngineHoldergetEngine in interface EngineHolder<CoreEngine>@Generated(value="lombok") public String getName()
Entity@Generated(value="lombok") public boolean isDestroy()
@Generated(value="lombok") public void setParent(Node parent)
Entity@Generated(value="lombok") public void setEngine(CoreEngine engine)
EntitysetEngine in interface EngineHolder<CoreEngine>setEngine in interface Entityengine - The new coreengine@Generated(value="lombok") public void setName(String name)
@Generated(value="lombok") public void setDestroy(boolean destroy)
@Generated(value="lombok") public boolean equals(Object o)
@Generated(value="lombok") protected boolean canEqual(Object other)
@Generated(value="lombok") public int hashCode()
@Generated(value="lombok") public String toString()
Copyright © 2015. All rights reserved.