Package name.moore.kevin.ze.entities
Class baseEF
java.lang.Object
name.moore.kevin.ze.entities.baseEF
- Direct Known Subclasses:
engineEF,engineEF,engineSpecEF,engineSpecEF,factionEF,hullEF,hullEF,hullSpecEF,hullSpecEF,industryEF,industryEF,industrySpecEF,industrySpecEF,planetEF,planetEF,planetSpecEF,planetSpecEF,shieldEF,shieldEF,shieldSpecEF,shieldSpecEF,shipEF,shipEF,shipEF,shipSpecEF,shipSpecEF,shipSpecEF,shipyardEF,shipyardEF,shipyardSpecEF,shipyardSpecEF,speciesSpecEF,starEF,starEF,starSpecEF,starSpecEF,weaponEF,weaponEF,weaponSpecEF,weaponSpecEF
Factories produce entities in the entity repository. All the specialised
factories inherit from here to provide some common functions.
By default most methods are NOP, the specialised factories override to create their functionality.
There is no direct reference to the entityrepository. Any actions on the entities are done by the verbs.
- Author:
- Kevin Moore
<dev@kevin.moore.name> - See Also:
name.moore.kevin.ze.game.verbs
-
Field Summary
FieldsModifier and TypeFieldDescriptionDerived factories should add values to these Maps for use in calculations.static hasherprivate static org.slf4j.Loggerprivate com.simsilica.es.EntityIdThe database entity this processor is going to process. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvide a list of components created by this processor when creating an entity.protected com.simsilica.es.EntityIdfindbyName(reference name)protected com.simsilica.es.EntityIdfindbyName(reference name, Class clazz)protected Set<com.simsilica.es.EntityId>findEntities(com.simsilica.es.ComponentFilter cf, Class[] clazzes)<T extends XMLbase>
com.simsilica.es.EntityIdfrom()Create a new entity appropriate to the factory.<T extends XMLbase>
com.simsilica.es.EntityIdfromXML(T cast)Convert from parsed XML into an entity complete with appropriate components.com.simsilica.es.EntityComponentgetComponent(com.simsilica.es.EntityId eid, Class clazz)com.simsilica.es.EntityIdmakeSerial(Class item)Make a unique serial-number String in the formatengine.XJ4ONH2F.setTarget(com.simsilica.es.EntityId eid)Set the specific entityId in the entity database that this processor will process.Used by factories to produce hardcoded test fixtures - so we dont need to specify any specs.toComponents(com.simsilica.es.EntityId seid)Provide the components of an entity based on a specification.toComponents(T cast)Use the parsed XML object to create the components of an entity.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
hasher
-
ABSORB_SCALER
Derived factories should add values to these Maps for use in calculations. These are used to scale energy damage and absorb calculation to reasonable values. fragile values are used to determine how relatively damageable a component is.- See Also:
fire
-
DAMAGE_SCALER
-
FRAGILE_SCALER
-
target
private com.simsilica.es.EntityId targetThe database entity this processor is going to process.
-
-
Constructor Details
-
baseEF
public baseEF()
-
-
Method Details
-
makeSerial
Make a unique serial-number String in the formatengine.XJ4ONH2F.- Parameters:
item-- Returns:
-
setTarget
Set the specific entityId in the entity database that this processor will process.- Parameters:
eid-- Returns:
-
getTarget
public com.simsilica.es.EntityId getTarget() -
diagnostic
Provide a list of components created by this processor when creating an entity.- Returns:
-
toComponents
Use the parsed XML object to create the components of an entity.- Type Parameters:
T-- Parameters:
cast-- Returns:
-
toComponents
public <T extends XMLbase> List<com.simsilica.es.EntityComponent> toComponents(com.simsilica.es.EntityId seid)Provide the components of an entity based on a specification. Component values will be defaulted. Public because the construct verb uses it.- Type Parameters:
T-- Parameters:
seid- entityid of the specification to base the components on.- Returns:
- See Also:
construct.build(com.simsilica.es.EntityId)
-
toComponents
Used by factories to produce hardcoded test fixtures - so we dont need to specify any specs.- Type Parameters:
T-- Returns:
-
fromXML
Convert from parsed XML into an entity complete with appropriate components.The required components are provided by the specialised processor (which is calling this method!).
- Type Parameters:
T-- Parameters:
cast-- Returns:
- EntityId of newly created and populated entity.
-
from
Create a new entity appropriate to the factory.- Type Parameters:
T-- Returns:
-
findbyName
- Parameters:
name-- Returns:
-
findbyName
-
getComponent
-
findEntities
-