Package de.Keyle.MyPet.api.skill
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
-
Method Details
-
apply
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
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 ofapply(Skill).- Parameters:
skill- the skill instance to roll back
-