Exemple #1
0
        public object ReadKey(IKey key, ILogPrinter inLogger)
        {
            Vector3 v = new Vector3();

            v.x = key.GetValue(0).ToFloat();
            v.y = key.GetValue(1).ToFloat();
            v.z = key.GetValue(2).ToFloat();

            return(v);
        }
Exemple #2
0
        public void DeserializationFromCscd(IKey key, ILogPrinter inLogger)
        {
            if (key.GetValuesCount() != 3)
            {
                return;
            }

            x = key.GetValue(0).ToFloat();
            y = key.GetValue(1).ToFloat();
            z = key.GetValue(2).ToFloat();
        }
Exemple #3
0
        public void DeserializationFromCscd(IKey key, ILogPrinter inLogger)
        {
            if (key.GetValuesCount() == 0)
            {
                inLogger.LogError(string.Format("NamedId.CscdConverter: Key {0} hasnt value!", key.GetPath()));
                return;
            }
            string  n   = key.GetValue(0).ToString();
            NamedId nid = GetNamedId(n);

            id   = nid.id;
            name = nid.name;
        }
Exemple #4
0
        void AddToTree(IKey key, TreeNodeCollection nc)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < key.GetValuesCount(); i++)
            {
                IKeyValue value = key.GetValue(i);

                string val_comments = string.Empty;
                if (!string.IsNullOrEmpty(value.Comments))
                {
                    val_comments = string.Format("[//{0}]", value.Comments);
                }

                sb.AppendFormat("{0}{1}, ", value, val_comments);
            }

            string arr_flag = string.Empty;

            if (key.IsArrayKey())
            {
                arr_flag = "[a]";
            }

            string key_comments = string.Empty;

            if (!string.IsNullOrEmpty(key.Comments))
            {
                key_comments = string.Format(" //{0}", key.Comments);
            }

            TreeNode tn = new TreeNode(string.Format("{0}{1}: {2}{3}", key.GetName(), arr_flag, sb, key_comments));

            nc.Add(tn);

            for (int i = 0; i < key.GetChildCount(); i++)
            {
                IKey el = key.GetChild(i);
                AddToTree(el, tn.Nodes);
            }
        }