Package forestry.api.core
Interface IErrorLogic
- All Superinterfaces:
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 TypeMethodDescriptionvoidRemoves all current errors.booleandefault voidfromArray(short[] errorArray) Sets this logic's errors using the specified errors array.booleanbooleansetCondition(boolean condition, IError error) Adds the error when condition is true, removes it when condition is false.default short[]toArray()Methods inherited from interface forestry.api.core.IErrorSource
getErrors
-
Method Details
-
setCondition
Adds the error when condition is true, removes it when condition is false.- Returns:
- The value of condition.
-
contains
- Returns:
trueIf this error logic currently has the given error.
-
hasErrors
boolean hasErrors()- Returns:
trueif 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.
-