Interface UpgradeParser<S extends Skill>

Type Parameters:
S - the skill this parser produces upgrades for
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UpgradeParser<S extends Skill>
Reads one level's upgrade for a skill out of a skilltree's JSON.
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(JsonObject upgradeJson)
    Parses an Upgrade for skill S from a skilltree JSON node.
  • Method Details

    • parse

      Upgrade<S> parse(JsonObject upgradeJson)
      Parses an Upgrade for skill S from a skilltree JSON node.

      Called by the skilltree loader for each Skills.<name>.Upgrades.<level> block in an .st.json file. The upgradeJson object is the JSON object directly under the level rule (e.g. {"damage": "+5"}).

      Return null if the JSON cannot be parsed into a valid upgrade — the loader will log and skip the entry. Returning an upgrade with no modifiers set (e.g., all fields absent from the JSON) is also valid; the loader will install it as a no-op upgrade for that level.

      Parameters:
      upgradeJson - the JSON block under the level rule
      Returns:
      the parsed upgrade, or null when the block cannot be read