Package name.moore.kevin.ze.game.verbs
Class fire.calc
java.lang.Object
name.moore.kevin.ze.game.verbs.fire.calc
- Enclosing class:
- fire
Using the inner class allows the calculation to be applied in a stream
through all the individual parts.
Usage :
remaining = new calc(i, remaining).absorb().damage().getEnergy();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doublecom.simsilica.es.EntityIdorg.jscience.physics.amount.Amount<javax.measure.quantity.Energy> -
Constructor Summary
ConstructorsConstructorDescriptioncalc(com.simsilica.es.EntityId id, org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> incoming) -
Method Summary
Modifier and TypeMethodDescriptionprivate fire.calcabsorb()Some parts can safely absorb incoming energy eg shields by countering with their own accumulated energy.private fire.calcdamage()Apply any remaining energy against the specified part, reducing a random proportion the energy but reducing the health of the equipment.private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy>End the calculation chain returning the current energy to be processed - if called directly after weapon() this would be the weapons' output.
-
Field Details
-
partid
public com.simsilica.es.EntityId partid -
remaining
public org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> remaining -
absorbscaler
private double absorbscaler -
damagescaler
private double damagescaler
-
-
Constructor Details
-
calc
calc(com.simsilica.es.EntityId id, org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> incoming)- Parameters:
id- the individual partincoming- energy that gets reduced by impacting this part.
-
-
Method Details
-
damage
Apply any remaining energy against the specified part, reducing a random proportion the energy but reducing the health of the equipment.More massive parts are less prone to damage.
- Parameters:
d-- Returns:
- this so we can chain methods.
-
absorb
Some parts can safely absorb incoming energy eg shields by countering with their own accumulated energy. Otherwise there is no effect.- Returns:
-
getEnergy
private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> getEnergy()End the calculation chain returning the current energy to be processed - if called directly after weapon() this would be the weapons' output.- Returns:
-