示例#1
0
        public static void SetJumpInfo(string agentFullname, string thisThree, int nodeId, string jumpTree)
        {
            if (!_btStack.ContainsKey(agentFullname))
            {
                _btStack[agentFullname] = new List <BTStackItem>();
            }

            BTStackItem item = new BTStackItem();

            item.thisTree = thisThree + ".xml";
            item.nodeId   = nodeId;
            item.jumpTree = jumpTree + ".xml";

            //push at the end
            _btStack[agentFullname].Add(item);
        }
示例#2
0
        private static void CheckJump(string agentFullname, ref string behaviorFilename, ref string nodeId)
        {
            List <BTStackItem> stack = GetStack(agentFullname);

            if (stack != null && stack.Count > 0)
            {
                BTStackItem top = stack[stack.Count - 1];

                if (top.jumpTree == behaviorFilename)
                {
                    behaviorFilename = stack[0].thisTree;

                    string id = "";
                    for (int i = 0; i < stack.Count; ++i)
                    {
                        id += string.Format("{0}:", stack[i].nodeId);
                    }

                    id += nodeId;

                    nodeId = id;
                }
            }
        }
示例#3
0
        public static void SetJumpInfo(string agentFullname, string thisThree, int nodeId, string jumpTree)
        {
            if (!_btStack.ContainsKey(agentFullname))
            {
                _btStack[agentFullname] = new List<BTStackItem>();
            }

            BTStackItem item = new BTStackItem();
            item.thisTree = thisThree + ".xml";
            item.nodeId = nodeId;
            item.jumpTree = jumpTree + ".xml";

            //push at the end
            _btStack[agentFullname].Add(item);
        }