Interface BattleProperty<T>

Type Parameters:
T - The type of the property
All Known Implementing Classes:
AbstractBooleanProperty, AbstractIntegerProperty, BattleTypeProperty, ClausesProperty, ExitableProperty, FullHealProperty, LevelCapProperty, NoCritsProperty, NumPokemonProperty, OldGenModeProperty, RaiseToCapProperty, TeamPreviewProperty, TeamSelectProperty, TierProperty, TurnTimeProperty

public interface BattleProperty<T>
An interface representing a property (rule) of a battle with the given type
  • Method Details

    • getId

      String getId()
      The id of the property
      Returns:
      The id
    • requiredByClient

      boolean requiredByClient()
      If the property's value is required by the client for UI logic
      Returns:
      True if required by the client
    • parse

      Attempts to parse the object into a PropertyValue<T> Will return Optional.empty() if fails to parse
      Parameters:
      o - The object being parsed
      Returns:
      The optional PropertyValue<T>
    • getDefault

      Optional<PropertyValue<T>> getDefault()
      Gets the default value when not supplied If returning an empty optional this means it isn't always required
      Returns:
      The default Optional<PropertyValue<T>>
    • getInstance

      PropertyValue<T> getInstance()
      Gets a new instanceof the PropertyValue<T>
      Returns:
      The new value instance