예제 #1
0
 public BotIsWithinSight(BotPartVision botVisionComponent, string targetTag,
                         BehaviourNode decoratee, bool inverseCondition = false,
                         string nodeName     = NODE_NAME,
                         AbortRule abortRule = AbortRule.NONE) : base(decoratee, nodeName, abortRule)
 {
     _botVisionComponent = botVisionComponent;
     TargetTag           = targetTag;
     _inverseCondition   = inverseCondition;
     Init(IsWithinSight);
 }
예제 #2
0
        //private bool m_initParent = false;
        public BehaviourObserver(string name, BehaviourNode decoratee, AbortRule abortRule) : base(name, NodeType.DECORATOR)
        {
            OnStarted.AddListener(OnStarted_Listener);
            OnStopping.AddListener(OnStopping_Listener);
            OnChildNodeStopped.AddListener(OnChildNodeStopped_Listener);
            OnChildNodeStoppedSilent.AddListener(OnChildNodeStoppedSilent_Listener);

            m_abortRule   = abortRule;
            m_isObserving = false;
            AddChild(decoratee);
        }
예제 #3
0
 /// <summary>
 /// Execute child node if the given condition returns true
 /// </summary>
 /// <param name="isConditionMetFunc">The function used to check the condition</param>
 /// <param name="checkInterval">The interval at which the condition is checked</param>
 /// <param name="checkVariance">The interval variance</param>
 /// <param name="decoratee">The child run to run if condition is true</param>
 /// <param name="abortRule">The parameter allows the Decorator to stop the execution of a running subtree within it's parent's Composite.</param>
 public BehaviourCondition(Func <bool> isConditionMetFunc, float checkInterval, float checkVariance, BehaviourNode decoratee, AbortRule abortRule = AbortRule.NONE) : base(NODE_NAME, decoratee, abortRule)
 {
     Init(isConditionMetFunc, checkInterval, checkVariance);
 }
예제 #4
0
 /// <summary>
 /// Execute child node if the given condition returns true
 /// </summary>
 /// <param name="isConditionMetFunc">The function used to check the condition</param>
 /// <param name="decoratee">The child run to run if condition is true</param>
 /// <param name="abortRule">The parameter allows the Decorator to stop the execution of a running subtree within it's parent's Composite.</param>
 public BehaviourCondition(Func <bool> isConditionMetFunc, BehaviourNode decoratee, AbortRule abortRule = AbortRule.NONE) : base(NODE_NAME, decoratee, abortRule)
 {
     Init(isConditionMetFunc);
 }
예제 #5
0
 protected BehaviourCondition(BehaviourNode decoratee, string nodeName = NODE_NAME, AbortRule abortRule = AbortRule.NONE) : base(NODE_NAME, decoratee, abortRule)
 {
 }
예제 #6
0
 public BehaviourBlackboardObserver(string name, BehaviourBlackboard blackboard, BehaviourNode decoratee, AbortRule stopRule) : base(name, decoratee, stopRule)
 {
     this.blackboard = blackboard;
 }
예제 #7
0
 /// <summary>
 /// Execute the child node only if the Blackboard's key matches the op / value condition.
 /// </summary>
 /// <param name="blackboard">The blackboard that holds the value to check and checks the condition</param>
 /// <param name="key">The key of the value</param>
 /// <param name="conditionoperator">The operator used to check the value</param>
 /// <param name="decoratee">The child node</param>
 /// <param name="stoprule"></param>
 public BehaviourBlackboardCondition(BehaviourBlackboard blackboard, string key, Operator conditionoperator, BehaviourNode decoratee, AbortRule stoprule) : base("BlackboardCondition", blackboard, decoratee, stoprule)
 {
     Init(key, conditionoperator);
 }
 /// <summary>
 /// Execute child node if the given condition inverse returns true
 /// </summary>
 /// <param name="isConditionMetFunc">The function used to check the condition</param>
 /// <param name="checkInterval">The interval at which the condition is checked</param>
 /// <param name="checkVariance">The interval variance</param>
 /// <param name="decoratee">The child run to run if condition is true</param>
 /// <param name="abortRule">The parameter allows the Decorator to stop the execution of a running subtree within it's parent's Composite.</param>
 public BehaviourConditionInverse(Func <bool> isConditionMetFunc, float checkInterval, float checkVariance, BehaviourNode decoratee, AbortRule abortRule = AbortRule.NONE) : base(isConditionMetFunc, checkInterval, checkVariance, decoratee, abortRule)
 {
     Name = NODE_NAME;
 }
 /// <summary>
 /// Execute child node if the given condition inverse returns true
 /// </summary>
 /// <param name="isConditionMetFunc">The function used to check the condition</param>
 /// <param name="decoratee">The child run to run if condition is true</param>
 /// <param name="abortRule">The parameter allows the Decorator to stop the execution of a running subtree within it's parent's Composite.</param>
 public BehaviourConditionInverse(Func <bool> isConditionMetFunc, BehaviourNode decoratee, AbortRule abortRule = AbortRule.NONE) : base(isConditionMetFunc, decoratee, abortRule)
 {
     Name = NODE_NAME;
 }
예제 #10
0
 /// <summary>
 /// BlackboardCondition allows to check only one key, this one will observe multiple blackboard keys and evaluate
 /// the given query function as soon as one of the value's changes, allowing you to do arbitrary queries on the blackboard.
 /// </summary>
 /// <param name="blackboard">The blackboard that holds the queries to check</param>
 /// <param name="observerkeys">Keys of the queries to check</param>
 /// <param name="decoratee">The child node</param>
 /// <param name="stoprule">Stop execution of running nodes based on the rule</param>
 /// <param name="query">The query to execute</param>
 public BehaviourBlackboardQuery(BehaviourBlackboard blackboard, string[] observerkeys, BehaviourNode decoratee, AbortRule stoprule, System.Func <bool> query) : base("BlackboardQuery", blackboard, decoratee, stoprule)
 {
     m_observerkeys = observerkeys;
     m_query        = query;
 }