API Docs for:
Show:

ResolvableAction Class

Defined in: src/action.js:85

A resolvable action implementation. Handles the resolution of a source object performing an action on a target object. Resolvable action logic is attached to and primarily related to the target. Methods on this object should only be called by the {{#crossLink "ResolvableActionInterface"}}{{/crosslink}}

If any of the functions on this object should always return true or false it can be set to a Boolean value that will be used instead of the value returned by calling the function.

Item Index

Methods

canResolveAction

(
  • action
  • source
  • [settings]
)
Bool

Defined in src/action.js:100

Checks if the entity with this ResolvableAction can currently resolve the action given source and settings. Instead of a function this.canPerformAction can be set to a boolean value if the check should always be true or false.

If this functions should always return true or false it can be set to a Boolean value that will be used instead of the value returned by calling the function.

Parameters:

  • action String
    • The action being performed on this target to resolve.
  • source Object
    • The source object performing the action on this target.
  • [settings] Object optional
    • Settings for the action.

Returns:

Bool:

resolveAction

(
  • action
  • source
  • [settings]
)
Boolean

Defined in src/action.js:115

Resolves an action on target from source with given settings.

Parameters:

  • action String
    • The action being performed on this target to resolve.
  • source Object
    • The source object performing the action on this target.
  • [settings] Object optional
    • Settings for the action.

Returns:

Boolean:

true if the action was successfully resolved.