Class shieldSpec
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IntegerThe base number of days to construct this shield.private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy>The maximum amount of energy that the shield can absorb per game-tick to function.private static org.slf4j.Loggerprivate org.jscience.physics.amount.Amount<javax.measure.quantity.Mass>Mass of the component in kilogrammes.private org.jscience.physics.amount.Amount<org.jscience.economics.money.Money>The base cost of constructing this item.private intThe size of this shield. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jscience.physics.amount.Amount<javax.measure.quantity.Energy>Derived classes have to override this and say what class eg engine.class they are.org.jscience.physics.amount.Amount<javax.measure.quantity.Mass>getMass()org.jscience.physics.amount.Amount<org.jscience.economics.money.Money>getMoney()intgetSize()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, getSpec, missingXMLmessage
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
size
private int sizeThe size of this shield.This takes up space in the hull and limits what can be installed into which bay in the hull.
Optional element in XML<size>. Defaulted to one. -
money
@XStreamConverter(SingleValueMoneyConverter.class) private org.jscience.physics.amount.Amount<org.jscience.economics.money.Money> moneyThe base cost of constructing this item.This may be modified by factors considered in the construction logic. It is always an exact value, no decimals.
Optional element in XML<money>. Defaults to zero if not provided. -
daystobuild
The base number of days to construct this shield.This value may be changed by construction systems which take into account things such as a damaged factory.
Optional element in XML<daystobuild>. Defaults to 1. -
mass
@XStreamConverter(SingleValueMassConverter.class) private org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> massMass of the component in kilogrammes. Required XML<mass>100000 t</mass> -
energy
@XStreamConverter(SingleValueEnergyConverter.class) private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> energyThe maximum amount of energy that the shield can absorb per game-tick to function.The amount of energy a shield can absorb relates to how much energy is being provided to it by an engine. The more provided to stronger the shield. This is a maximum that can be transferred to this shield.
Required XML element<energy>10 GJ></energy>
-
-
Constructor Details
-
shieldSpec
public shieldSpec()
-
-
Method Details
-
getSize
public int getSize()- Returns:
-
getMoney
public org.jscience.physics.amount.Amount<org.jscience.economics.money.Money> getMoney()- Returns:
-
getDaystobuild
- Returns:
-
getMass
public org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> getMass()- Returns:
-
getEnergy
public org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> getEnergy()- 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:
-