Class ship
<ship> XML element into an entity and components.- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.jme3.math.Vector2fOptional element in XML<coord>10,33.1</coord>.private static Stringprivate static org.slf4j.Loggerprivate referenceOptional element in XML<orbiting key="Sol">3</orbiting>.private referenceOptional element in XML<spec key="S"></spec>. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.jme3.math.Vector2fgetCoord()Derived classes have to override this and say what class eg engine.class they are.getSpec()Derived classes override if they really do want to return a spec reference.protected ObjectCalled automatically when loading from XML as part of JDK serialisation.Methods inherited from class name.moore.kevin.ze.XMLdata.XMLbase
defaultXMLmessage, duplicatedXMLmessage, getDescription, getKey, missingXMLmessage
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULTSPEC
-
spec
@ZodiacEntityReference @XStreamConverter(AttributedValueReferenceConverter.class) private reference specOptional element in XML<spec key="S"></spec>.This ships specification eg "Light Frigate" - these specs are handled in shipSpec. This field contains a String reference to the specification, not it's actual EntityId so we need to do a lookup via getEntityReference()
If this isn't specified then it is defaulted to "U" - unclassified.
- See Also:
shipSpec
-
orbiting
@ZodiacEntityReference @XStreamConverter(AttributedValueReferenceConverter.class) private reference orbitingOptional element in XML<orbiting key="Sol">3</orbiting>.This is a String reference to another entity to be in orbit around. It will need to be resolved to a real entity via getEntityReference(). If it isn't provided then we must have a coordinate(vector2f) element.
- See Also:
name.moore.kevin.ze.entities.entityFactory#makeEntity(name.moore.kevin.ze.XMLdata.XMLbase)
-
coord
Optional element in XML<coord>10,33.1</coord>. If this isn't provided we must have an orbiting element.
-
-
Constructor Details
-
ship
public ship()
-
-
Method Details
-
getSpec
Description copied from class:XMLbaseDerived classes override if they really do want to return a spec reference. -
getOrbiting
- Returns:
-
getCoord
public com.jme3.math.Vector2f getCoord()- Returns:
-
readResolve
Description copied from class:XMLbaseCalled automatically when loading from XML as part of JDK serialisation.Used to do some validation of that incoming XML by asserting that properties are set and have defaults as required. Output warning messages if a default is applied. Output error messages if a required XML element is missing and return null to indicate an invalid object.
- Overrides:
readResolvein classXMLbase- Returns:
- null if we can't create a valid object
-
getEntityClass
Description copied from class:XMLbaseDerived classes have to override this and say what class eg engine.class they are. This allows us to use this base class but discover the derived class.- Specified by:
getEntityClassin classXMLbase- Returns:
-