Package name.moore.kevin.ze.XMLdata
Class shield
java.lang.Object
name.moore.kevin.ze.XMLdata.XMLbase
name.moore.kevin.ze.XMLdata.shield
Shields absorb incoming damage.
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDerived classes have to override this and say what class eg engine.class they are.javax.measure.Measure<Double,javax.measure.quantity.Dimensionless>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 -
spec
@ZodiacEntityReference @XStreamConverter(AttributedValueReferenceConverter.class) private reference specRequired element in XML<spec key="S01"></spec>.The technical specification of the shield.
- See Also:
shieldSpec,spec
-
health
@XStreamConverter(SingleValuePercentConverter.class) private javax.measure.Measure<Double,javax.measure.quantity.Dimensionless> healthOptional XML element to specify the health of this component, defaults to 100 (percent).<health>45.1</health> Any values supplied over 100.00 will be chopped to 100.00
-
-
Constructor Details
-
shield
public shield()
-
-
Method Details
-
getSpec
Description copied from class:XMLbaseDerived classes override if they really do want to return a spec reference. -
getHealth
- 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:
-