Class fire.calc

java.lang.Object
name.moore.kevin.ze.game.verbs.fire.calc
Enclosing class:
fire

class fire.calc extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private double
     
    private double
     
    com.simsilica.es.EntityId
     
    org.jscience.physics.amount.Amount<javax.measure.quantity.Energy>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    calc​(com.simsilica.es.EntityId id, org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> incoming)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private fire.calc
    Some parts can safely absorb incoming energy eg shields by countering with their own accumulated energy.
    private fire.calc
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 part
      incoming - energy that gets reduced by impacting this part.
  • Method Details

    • damage

      private fire.calc 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

      private fire.calc 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: