Class SpellCasting

java.lang.Object
SpellCasting

public class SpellCasting extends Object
Code to handle casting spells in the combat simulator. Compare use of Casting classes here to the Strategy pattern. Some implementations will be rough approximations of the real spell.
Since:
2021-12-18
  • Field Details

    • INF

      private static final int INF
      Infinity integer.
      See Also:
    • NUM_BY_AREA

      private static final int NUM_BY_AREA
      Code to compute num affected by area.
      See Also:
    • castingFormula

      private static final SpellCasting.Casting[] castingFormula
      List of available castings.
  • Constructor Details

    • SpellCasting

      public SpellCasting()
  • Method Details

    • linkSpellWithCasting

      public static boolean linkSpellWithCasting(Spell spell)
      Try to link a spell with its casting formula.
      Returns:
      true if casting was found.
    • main

      public static void main(String[] args)
      Main test function.