Package name.moore.kevin.ze.components
Class specification
java.lang.Object
name.moore.kevin.ze.components.specification
- All Implemented Interfaces:
com.simsilica.es.EntityComponent,iEntityReference
public class specification
extends Object
implements com.simsilica.es.EntityComponent, iEntityReference
An entity with this component has a specification available and this component points to it.
An example would be a planet, it has a specification that describes the physical characteristics of that planet (a planetSpec) This component provides a reference to that planetSpec entity.
Also stored are some useful data that we typically want access to through the reference. Since we have that data at the point of creating this component, store it here rather than having to follow through the reference every time. Since specifications are not altered at runtime the data won't become stale.
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionspecification(com.simsilica.es.EntityId ref, String key, Class type)Set the EntityId of this specification. -
Method Summary
-
Field Details
-
reference
private com.simsilica.es.EntityId reference -
key
Unique String identity of the spec eg "E01". -
type
The class of things with this specification eg "engine.class"
-
-
Constructor Details
-
specification
Set the EntityId of this specification.- Parameters:
ref-key-type- engine.class
-
-
Method Details
-
getReference
public com.simsilica.es.EntityId getReference()Description copied from interface:iEntityReferenceThe EntityId of the entity referred to.This may be
EntityId.NULL_IDif the entity has not yet been located.- Specified by:
getReferencein interfaceiEntityReference- Returns:
-
getKey
- Returns:
-
getType
The class of things with this specification eg "engine.class"- Returns:
-
toString
-