Exemple #1
0
        public static BehaviorNode CreateLoopNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition)
        {
            var Node = new BehaviorLoopNode(Name, Parent, Condition);

            Parent?.AddChild(Node);
            return(Node);
        }
Exemple #2
0
        public BehaviorParallelNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null)
            : base(Name, Parent, Condition)
        {
            Mode_ = BehaviorParallelMode.Or;

            ChildrenState_ = new BehaviorRunningState[MaxChildCount];
            for (var Index = 0; Index < MaxChildCount; ++Index)
            {
                ChildrenState_[Index] = BehaviorRunningState.Running;
            }
        }
Exemple #3
0
        public BehaviorNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null)
        {
            this.Name = Name;

            Parent_             = Parent;
            Children_           = new BehaviorNode[MaxChildCount];
            ChildCount_         = 0;
            Condition_          = null;
            ActiveNode_         = null;
            PreviousActiveNode_ = null;

            SetCondition(Condition);
        }
Exemple #4
0
 public BehaviorPreconditionXor(BehaviorPrecondition Left, BehaviorPrecondition Right)
 {
     Left_  = Left;
     Right_ = Right;
 }
Exemple #5
0
 public BehaviorPreconditionNot(BehaviorPrecondition Left)
 {
     Left_ = Left;
 }
Exemple #6
0
        public static BehaviorNode CreateTerminalNode <T>(string Name, BehaviorNode Parent, BehaviorPrecondition Condition) where T : BehaviorTerminalNode, new()
        {
            var Node = new T {
                Name = Name
            };

            Node.SetParent(Parent);
            Node.SetCondition(Condition);
            Parent?.AddChild(Node);
            return(Node);
        }
Exemple #7
0
        public static BehaviorNode CreateParallelNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition, BehaviorParallelMode Mode)
        {
            var Node = new BehaviorParallelNode(Name, Parent, Condition);

            Node.SetMode(Mode);
            Parent?.AddChild(Node);
            return(Node);
        }
Exemple #8
0
 public BehaviorPrecondition SetCondition(BehaviorPrecondition Condition)
 {
     Condition_ = Condition;
     return(Condition_);
 }
Exemple #9
0
 public BehaviorLoopNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null, int LoopCount = -1)
     : base(Name, Parent, Condition)
 {
     LoopCount_    = LoopCount;
     CurrentCount_ = 0;
 }
Exemple #10
0
 public BehaviorSequenceNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null)
     : base(Name, Parent, Condition)
 {
     CurrentSelectIndex_ = InvalidIndex;
 }
Exemple #11
0
 public BehaviorNonePrioritySelectorNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null)
     : base(Name, Parent, Condition)
 {
 }
Exemple #12
0
 public BehaviorPrioritySelectorNode(string Name, BehaviorNode Parent, BehaviorPrecondition Condition = null)
     : base(Name, Parent, Condition)
 {
     CurrentSelectIndex_  = InvalidIndex;
     PreviousSelectIndex_ = InvalidIndex;
 }