blueshell
Version:
A Behavior Tree implementation in modern Javascript
21 lines (18 loc) • 562 B
text/typescript
/**
* Created by josh on 1/12/16.
*/
import { RepeatWhen } from './RepeatWhen';
import { BlueshellState, BaseNode } from '../../models';
/**
* The child Node repeats handling the event if the child resulted in a specified status.
* 1/12/16
* @author Joshua Chaitin-Pollak
*/
export class RepeatOnResult<S extends BlueshellState, E> extends RepeatWhen<S, E> {
constructor(repeatRes: string, child: BaseNode<S, E>) {
super('ResultEquals-' + repeatRes, child, (state, event, res) => res === repeatRes);
}
get symbol(): string {
return '⊜↻';
}
}