Methods
# bind(ayva)
Binds this behavior to the specified Ayva instance.
Not to be confused with Function.prototype.bind(). Although the effect is similar. This affects start(), generate(), iterated(), and when calling this behavior using the shorthand callable syntax.
Parameters:
Name | Type | Description |
---|---|---|
ayva |
Ayva |
this behavior
# generator generate(ayvaopt)
Generate the actions that make up this behavior. Subclasses must implement this method.
For full details on how to implement this method, see the Behavior API tutorial.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ayva |
Ayva |
<optional> |
instance of Ayva to generate actions for. Defaults to the Ayva instance bound to this behavior (if it exists). |
# generator iterated(ayvaopt, count)
Repeats the actions that make up this behavior the specified number of iterations.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ayva |
Ayva |
<optional> |
instance of Ayva to generate actions for. Defaults to the Ayva instance bound to this behavior (if it exists). |
|
count |
Number | 1 | the number of iterations |
# next(ayva)
Generate and return the next action of this behavior.
Parameters:
Name | Type | Description |
---|---|---|
ayva |
Ayva | defaults to the bound instance (if any) |
- the next action.
# perform(ayvaopt)
Perform one step of this behavior.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ayva |
Ayva |
<optional> |
instance of Ayva to use. Defaults to the Ayva instance bound to this behavior (if it exists). |
Promise that resolves when the step is complete.
# unbind()
Unbind this behavior from any Ayva instance.