示例#1
0
        public void CopyTo(Agent pAgent, Variables target)
        {
            target.m_variables.Clear();

            var e = this.m_variables.Keys.GetEnumerator();

            while (e.MoveNext())
            {
                uint id = e.Current;
                IInstantiatedVariable pVar = this.m_variables[id];
                IInstantiatedVariable pNew = pVar.clone();

                target.m_variables[id] = pNew;
            }

            if (!Object.ReferenceEquals(pAgent, null))
            {
                e = target.m_variables.Keys.GetEnumerator();
                while (e.MoveNext())
                {
                    uint id = e.Current;
                    IInstantiatedVariable pVar = this.m_variables[id];

                    pVar.CopyTo(pAgent);
                }
            }
        }
示例#2
0
        private void CopyTopValueTo(AgentState newly)
        {
            var e = this.m_variables.Keys.GetEnumerator();

            while (e.MoveNext())
            {
                uint id = e.Current;

                IInstantiatedVariable pVar = this.GetVariable(id);
                IInstantiatedVariable pNew = pVar.clone();

                newly.m_variables[id] = pNew;
            }
        }