コード例 #1
0
 public bool btload(Agent.State_t state)
 {
     state.Vars.CopyTo(this, this.m_variables);
     if (state.BT != null)
     {
         if (this.m_currentBT != null)
         {
             for (int i = 0; i < this.m_behaviorTreeTasks.Count; i++)
             {
                 BehaviorTreeTask behaviorTreeTask = this.m_behaviorTreeTasks[i];
                 if (behaviorTreeTask == this.m_currentBT)
                 {
                     Workspace.DestroyBehaviorTreeTask(behaviorTreeTask, this);
                     this.m_behaviorTreeTasks.Remove(behaviorTreeTask);
                     break;
                 }
             }
         }
         BehaviorNode node = state.BT.GetNode();
         this.m_currentBT = (BehaviorTreeTask)node.CreateAndInitTask();
         state.BT.CopyTo(this.m_currentBT);
         return(true);
     }
     return(false);
 }
コード例 #2
0
 public State_t(Agent.State_t c)
 {
     c.m_vars.CopyTo(null, this.m_vars);
     if (c.m_bt != null)
     {
         BehaviorNode node = c.m_bt.GetNode();
         this.m_bt = (BehaviorTreeTask)node.CreateAndInitTask();
         c.m_bt.CopyTo(this.m_bt);
     }
 }
コード例 #3
0
 public bool btsave(Agent.State_t state)
 {
     this.m_variables.CopyTo(null, state.Vars);
     if (this.m_currentBT != null)
     {
         Workspace.DestroyBehaviorTreeTask(state.BT, this);
         BehaviorNode node = this.m_currentBT.GetNode();
         state.BT = (BehaviorTreeTask)node.CreateAndInitTask();
         this.m_currentBT.CopyTo(state.BT);
         return(true);
     }
     return(false);
 }
コード例 #4
0
ファイル: Context.cs プロジェクト: raptoravis/behaviac1
        public bool Save(Dictionary <string, Agent.State_t> states)
        {
            foreach (KeyValuePair <string, Variables> pair in m_static_variables)
            {
                string    className = pair.Key;
                Variables variables = pair.Value;

                //states.insert(std::pair<const string, State_t>(className, State_t()));
                states[className] = new Agent.State_t();

                variables.CopyTo(null, states[className].Vars);
            }

            return(true);
        }
コード例 #5
0
        public bool Save(Dictionary <string, Agent.State_t> states)
        {
            var e = m_static_variables.GetEnumerator();

            while (e.MoveNext())
            {
                string    className = e.Current.Key;
                Variables variables = e.Current.Value;

                //states.insert(std::pair<const string, State_t>(className, State_t()));
                states[className] = new Agent.State_t();

                variables.CopyTo(null, states[className].Vars);
            }

            return(true);
        }