Enum KonquestUpgrade

java.lang.Object
java.lang.Enum<KonquestUpgrade>
konquest.api.model.KonquestUpgrade
All Implemented Interfaces:
Serializable, Comparable<KonquestUpgrade>, java.lang.constant.Constable

public enum KonquestUpgrade extends Enum<KonquestUpgrade>
An upgrade for a town. Upgrades have a cost in favor, and a population requirement. Upgrades can have multiple levels.
Author:
Rumsfield
  • Enum Constant Details

  • Method Details

    • values

      public static KonquestUpgrade[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static KonquestUpgrade valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getMaxLevel

      public int getMaxLevel()
      Gets the maximum levels for this upgrade.
      Returns:
      The maximum levels
    • getIcon

      public org.bukkit.Material getIcon()
      Gets the material used for menu icons.
      Returns:
      The material
    • getDescription

      public String getDescription()
      Gets the description of this upgrade.
      Returns:
      The description
    • getLevelDescription

      public String getLevelDescription(int level)
      Gets the level description, starting at 1. Level 0 returns empty string. Levels higher than the max level returns an empty string.
      Parameters:
      level - The level
      Returns:
      The level description
    • getUpgrade

      public static KonquestUpgrade getUpgrade(String name)
      Get the corresponding KonquestUpgrade enum that matches the given name. Returns null when the name does not match any enum.
      Parameters:
      name - The name of the enum
      Returns:
      The KonquestUpgrade enum that matches name