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.
23 lines (19 loc) • 380 B
JavaScript
;
(function() {
/**
* Provides unique integer ids
*/
class IdProvider {
constructor(){
this._nextId = 1;
}
newId() {
if (this._nextId === Number.MAX_SAFE_INTEGER) {
throw new Error('max id reached');
}
return this._nextId++;
}
}
angular.module('editorApp')
.service('IdProvider', IdProvider);
})();