コード例 #1
0
        public static List <ValueMark> GetValidValues(AgentType agentType, string agentFullname, int frame)
        {
            Debug.Check(!string.IsNullOrEmpty(agentFullname) && frame > -1);

            List <ValueMark> valueSet = new List <ValueMark>();

            if (_agentDatabase.ContainsKey(agentFullname))
            {
                AgentData agentData = _agentDatabase[agentFullname];

                // Properties
                if (agentType != null)
                {
                    //foreach (PropertyDef p in agentType.GetProperties())
                    //{
                    //    ValueMark value = agentData.GetValidValue(p.BasicName, frame);

                    //    if (value != null)
                    //        valueSet.Add(value);
                    //}

                    foreach (string valueName in agentData.ValueSet.Keys)
                    {
                        ValueMark value = agentData.GetValidValue(valueName, frame);

                        if (value != null)
                        {
                            valueSet.Add(value);
                        }
                    }
                }
            }

            return(valueSet);
        }
コード例 #2
0
ファイル: AgentData.cs プロジェクト: zuojiashun/behaviac
        public static List <ValueMark> GetValidValues(Nodes.Node node, AgentType agentType, string agentFullname, int frame)
        {
            Debug.Check(!string.IsNullOrEmpty(agentFullname) && frame > -1);

            List <ValueMark> valueSet = new List <ValueMark>();

            if (_agentDatabase.ContainsKey(agentFullname))
            {
                AgentData agentData = _agentDatabase[agentFullname];

                // Properties
                if (agentType != null)
                {
                    foreach (PropertyDef p in agentType.GetProperties())
                    {
                        ValueMark value = agentData.GetValidValue(p.Name, frame);
                        if (value != null)
                        {
                            valueSet.Add(value);
                        }
                    }
                }

                // Par
                if (node != null)
                {
                    foreach (ParInfo par in node.Pars)
                    {
                        ValueMark value = agentData.GetValidValue(par.Name, frame);
                        if (value != null)
                        {
                            valueSet.Add(value);
                        }
                    }
                }
            }

            return(valueSet);
        }
コード例 #3
0
        public static ValueMark GetValidValue(string agentFullname, string valueName, int frame)
        {
            Debug.Check(!string.IsNullOrEmpty(agentFullname) &&
                        !string.IsNullOrEmpty(valueName) &&
                        frame > -1);

            if (!_agentDatabase.ContainsKey(agentFullname))
            {
                return(null);
            }

            AgentData agentData = _agentDatabase[agentFullname];

            return(agentData.GetValidValue(valueName, frame));
        }