UNPKG

owl-bt

Version:

owl-bt is editor for Behavior trees. It has been inspired by Unreal engine behavior trees in a way, that it supports special node items like decorators and services. This makes trees smaller and much more readable.

35 lines (30 loc) 1.02 kB
'use strict'; (function() { angular.module('editorApp') .controller('DecoratorBasePropertyEditorCtrl', function(TreeSelection, SetTreeNodeItemBasePropertyValueAction) { function selIsDecorator() { return TreeSelection.selItemType() === 'decorator'; } function propertyAccessor(property, isSet, value){ if (selIsDecorator()) { let dec = TreeSelection.selItem(); if (isSet) { SetTreeNodeItemBasePropertyValueAction.exec({ node : TreeSelection.selNode(), nodeItem : dec, property : property, value : value, }); } else { return dec[property] || false; } } } this.inverseCheckCondition = function(value) { return propertyAccessor('inverseCheckCondition', arguments.length, value); }; this.periodic = function(value) { return propertyAccessor('periodic', arguments.length, value); }; }); })();