Interface Upgrade<T extends Skill>

Type Parameters:
T - the specific skill type this upgrade targets

public interface Upgrade<T extends Skill>
Represents a single level-up upgrade for a skill. Upgrades are produced by an UpgradeParser from .st.json skilltree data and are applied to the owning Skill when the pet reaches the corresponding level.

Upgrades must be invertible: when a skilltree is reset or changed, previously applied upgrades are rolled back via invert(Skill) so the skill's state returns to its pre-upgrade baseline.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(T skill)
    Applies this upgrade's modifiers to the given skill (e.g.
    void
    invert(T skill)
    Reverts this upgrade's modifiers from the given skill, restoring the skill to its state before this upgrade was applied.
  • Method Details

    • apply

      void apply(T skill)
      Applies this upgrade's modifiers to the given skill (e.g. adds damage, increases chance, enables a boolean flag).
      Parameters:
      skill - the skill instance to upgrade
    • invert

      void invert(T skill)
      Reverts this upgrade's modifiers from the given skill, restoring the skill to its state before this upgrade was applied. Must be the exact inverse of apply(Skill).
      Parameters:
      skill - the skill instance to roll back