コード例 #1
0
ファイル: BTGraph.cs プロジェクト: Dasik/DasikAI
 public override void Clear()
 {
     Root         = null;
     StatesSource = null;
     UpdateStates();
     base.Clear();
 }
コード例 #2
0
ファイル: BTGraph.cs プロジェクト: Dasik/DasikAI
        public override void RemoveNode(Node node)
        {
            if (node == Root)
            {
                Root = nodes.FirstOrDefault() as BTBlock;
            }
            if (node == StatesSource)
            {
                StatesSource = null;
                UpdateStates();
            }

            base.RemoveNode(node);
        }
コード例 #3
0
ファイル: BTGraph.cs プロジェクト: Dasik/DasikAI
        public override Node AddNode(Type type)
        {
            Node node = base.AddNode(type);

            if (Root == null)
            {
                Root = node as BTBlock;
            }

            if (type == typeof(StatesParamSource))
            {
                if (StatesSource != null)
                {
                    RemoveNode(node);
                    throw new NotImplementedException("States concatenation unsupported");
                }

                StatesSource = node as StatesParamSource;
                UpdateStates();
            }

            UpdateStates(node);
            return(node);
        }