Liking cljdoc? Tell your friends :D

cark.keechma.behavior-tree.controller

Use the namespace provided here to create your own keechma behavior tree controllers

Use the namespace provided here to create your own keechma behavior tree controllers
raw docstring

<cmd-send-eventcljs

(<cmd-send-event ctx event-name)
(<cmd-send-event ctx event-name arg)

This function send a command to the controller. This will result in sending a behavior tree event to the controller's behavior tree. The function is intended to be used from a component, passing its context as the first parameter. The second parameter is the event name, a keyword. The third optional parameter is the event argument.

This function send a command to the controller. 
This will result in sending a behavior tree event to the controller's behavior tree.
The function is intended to be used from a component, passing its context as the first parameter.
The second parameter is the event name, a keyword.
The third optional parameter is the event argument.
sourceraw docstring

<cmd-tickcljs

(<cmd-tick ctx)

This function sends a command to the controller. This will result in the controller's behavior tree to be ticked. That function is intended to be used from a component, passing its context as parameter.

This function sends a command to the controller. 
This will result in the controller's behavior tree to be ticked. That function is intended to be used from a component,
passing its context as parameter.
sourceraw docstring

app-db-pathcljs

(app-db-path controller)

Returns the path to the behavior tree database in the app-db, as seen by the controller.

Returns the path to the behavior tree database in the app-db, as seen by the controller.
sourceraw docstring

blackboard-reactioncljs

(blackboard-reaction controller-name)

Returns a function that takes an app-db-datom and returns a reagent reaction on the controller's blackboard.

Returns a function that takes an app-db-datom and returns a reagent reaction on the controller's blackboard.
sourceraw docstring

Controllercljs

source

default-apicljs

source

execute-send-eventcljs

(execute-send-event controller event-name)
(execute-send-event controller event-name event-arg)

This function sends a behavior tree event to the controller's behavior tree. It may be called during the execution of the :on-start and :on-stop functions as well as during the execution of the behavior tree event handlers.

This function sends a behavior tree event to the controller's behavior tree.
It may be called during the execution of the :on-start and :on-stop functions as well as
during the execution of the behavior tree event handlers.
sourceraw docstring

execute-tickcljs

(execute-tick controller)

This function ticks the behavior tree. It may be called during the execution of the :on-start and :on-stop function as well as during the execution of the behavior tree event handlers.

This function ticks the behavior tree. 
It may be called during the execution of the :on-start and :on-stop function as well as
during the execution of the behavior tree event handlers.
sourceraw docstring

get-blackboardcljs

(get-blackboard app-db controller-name)

Returns the blackboard for this controller

Returns the blackboard for this controller
sourceraw docstring

handle-bt-eventcljs

(handle-bt-event this app-db-atom event-name arg)

This internal function handles an event coming out of the behavior tree.

This internal function handles an event coming out of the behavior tree.
sourceraw docstring

handle-bt-eventscljs

(handle-bt-events this app-db-atom)

This internal function loops over the events coming out of the behavior tree, processing these according to the controller's configuration.

This internal function loops over the events coming out of the behavior tree,
processing these according to the controller's configuration.
sourceraw docstring

makecljs

(make params-func controller-api)

Returns a new behavior tree controller, customized with a behavior tree and associated parameters. Parameters:

  • params-fun : The params function is a regular keechma controller params function. It receives the controller as first parameter, and a route-params map as second parameter. It should return true if the controller is to be run in that context, false otherwise.
  • controller-api : This map may have several keys :
    • :on-start : this is the optional regular :on-start keeshma controller function. It receives the controller as first parameter, the params map as second argument, and the app-db as third argument. This function must return a possibly updated app-db.
    • :on-stop : this is the optional regular :on-stop keeshma controller function. It receives the controller as first parameter, the params map as second argument, and the app-db as third argument. This function must return a possibly updated app-db.
    • :tree : this is the actual behavior tree context, as returned by bt/hiccup->context on an hiccup notation behavior tree.
    • :tree-init-func : this function receives the current behavior tree context and returns an initialized tree. This function is called when the controller is started
    • :tree-events : this map has keyword event names as keys and event handler functions as values. An event handler receives the controller instance as its first parameter, the app-db-atom as its second parameter and the event arg as third parameter.
Returns a new behavior tree controller, customized with a behavior tree and associated parameters.
Parameters:
- params-fun : The params function is a regular keechma controller params function. It receives the controller as first parameter, 
and a route-params map as second parameter. It should return true if the controller is to be run in that context, false otherwise.
- controller-api : This map may have several keys :
  - :on-start : this is the optional regular :on-start keeshma controller function. It receives the controller as first parameter,
the params map as second argument, and the app-db as third argument. This function must return a possibly updated app-db.
  - :on-stop : this is the optional regular :on-stop keeshma controller function. It receives the controller as first parameter,
the params map as second argument, and the app-db as third argument. This function must return a possibly updated app-db.
  - :tree : this is the actual behavior tree context, as returned by bt/hiccup->context on an hiccup notation behavior tree.
  - :tree-init-func : this function receives the current behavior tree context and returns an initialized tree. This function is
called when the controller is started
  - :tree-events : this map has keyword event names as keys and event handler functions as values. An event handler receives
the controller instance as its first parameter, the app-db-atom as its second parameter and the event arg as third parameter.
sourceraw docstring

name->app-db-pathcljs

(name->app-db-path name)

Returns the path to the behavior tree database in the app-db

Returns the path to the behavior tree database in the app-db
sourceraw docstring

set-blackboardcljs

(set-blackboard app-db-atom controller-name value)

Sets the balckboard value for this controller.

Sets the balckboard value for this controller.
sourceraw docstring

update-blackboardcljs

(update-blackboard app-db-atom controller-name func & args)

Updates the blackboard of this controller with the func and args.

Updates the blackboard of this controller with the func and args.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close