public ConditionalDecorator(IConditional <T> conditional, bool shouldReevalute) { Insist.IsTrue(conditional is IConditional <T>, "conditional must implment IConditional"); _conditional = conditional; _shouldReevaluate = shouldReevalute; }
public SpriteAnimation getAnimation(TEnum key) { Insist.isTrue(_animations.ContainsKey(key), "{0} is not present in animations", key); return(_animations[key]); }
public BehaviorTree <T> Build(float updatePeriod = 0.2f) { Insist.IsNotNull(_currentNode, "Can't create a behaviour tree with zero nodes"); return(new BehaviorTree <T>(_context, _currentNode, updatePeriod)); }
public BehaviorTreeBuilder <T> Conditional(Func <T, TaskStatus> func) { Insist.IsFalse(_parentNodeStack.Count == 0, "Can't create an unnested Conditional node. It must be a leaf node."); return(SetChildOnParent(new ExecuteActionConditional <T>(func))); }
/// <summary> /// Splice a sub tree into the parent tree. /// </summary> public BehaviorTreeBuilder <T> SubTree(BehaviorTree <T> subTree) { Insist.IsFalse(_parentNodeStack.Count == 0, "Can't splice an unnested sub tree, there must be a parent tree."); return(SetChildOnParent(new BehaviorTreeReference <T>(subTree))); }
public BehaviorTreeBuilder <T> EndComposite() { Insist.IsTrue(_parentNodeStack.Peek() is Composite <T>, "attempting to end a composite but the top node is a decorator"); _currentNode = _parentNodeStack.Pop(); return(this); }
public BehaviorTreeBuilder <T> LogAction(string text) { Insist.IsFalse(_parentNodeStack.Count == 0, "Can't create an unnested Action node. It must be a leaf node."); return(SetChildOnParent(new LogAction <T>(text))); }
public BehaviorTreeBuilder <T> WaitAction(float waitTime) { Insist.IsFalse(_parentNodeStack.Count == 0, "Can't create an unnested Action node. It must be a leaf node."); return(SetChildOnParent(new WaitAction <T>(waitTime))); }
public void SetStyle(SelectBoxStyle style) { Insist.IsNotNull(style, "style cannot be null"); this.style = style; InvalidateHierarchy(); }
public TiledMapMover(TmxLayer collisionLayer) { Insist.IsNotNull(collisionLayer, nameof(collisionLayer) + " is required"); CollisionLayer = collisionLayer; TiledMap = collisionLayer.Map; }
/// <summary> /// Creates a new LockToken and associates it with the supplied parent /// </summary> internal LockToken(Padlock parent) { Insist.IsNotNull(parent, "parent"); _parent = parent; }
public override void OnAddedToEntity() { _ownerBody = this.GetComponent <FSRigidBody>(); Insist.IsNotNull(_ownerBody, "Joint added to an Entity with no RigidBody!"); CreateJoint(); }
public TilledFörflytareRef(TmxLayer collisionLayer) { Insist.IsNotNull(collisionLayer, nameof(collisionLayer) + " is required"); KollitionsLager = collisionLayer; Karta = collisionLayer.Map; }
public SplitPane SetMaxSplitAmount(float amount) { Insist.IsTrue(amount > 0, "maxAmount has to be <= 1"); _maxAmount = amount; return(this); }
public SplitPane SetMinSplitAmount(float amount) { Insist.IsTrue(amount < 0, "minAmount has to be >= 0"); _minAmount = amount; return(this); }