Interface IErrorLogic

All Superinterfaces:
IErrorSource

public interface IErrorLogic extends IErrorSource
Keeps track of all errors for an object. Create new instances using IErrorManager.createErrorLogic().
  • Field Summary

    Fields inherited from interface forestry.api.core.IErrorSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all current errors.
    boolean
     
    default void
    fromArray(short[] errorArray)
    Sets this logic's errors using the specified errors array.
    boolean
     
    boolean
    setCondition(boolean condition, IError error)
    Adds the error when condition is true, removes it when condition is false.
    default short[]
     

    Methods inherited from interface forestry.api.core.IErrorSource

    getErrors
  • Method Details

    • setCondition

      boolean setCondition(boolean condition, IError error)
      Adds the error when condition is true, removes it when condition is false.
      Returns:
      The value of condition.
    • contains

      boolean contains(IError error)
      Returns:
      true If this error logic currently has the given error.
    • hasErrors

      boolean hasErrors()
      Returns:
      true if this error logic currently has any errors.
    • clearErrors

      void clearErrors()
      Removes all current errors.
    • toArray

      default short[] toArray()
      Returns:
      The current errors as an array of numeric IDs. Used for network serialization.
    • fromArray

      default void fromArray(short[] errorArray)
      Sets this logic's errors using the specified errors array. Unknown errors are discarded.
      Parameters:
      errorArray - An array of numeric IDs that correspond to different errors.