Exemplo n.º 1
0
        protected override void ReadNodes <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, BXmlSerializerInterface xs)
        {
            var penum = mList.TypeValuesParams.kGetProtoEnumFromDB(xs.Database);

            foreach (var attrName in s.AttributeNames)
            {
                // The only attributes in this are actual member names so we don't waste time calling
                // penum.IsValidMemberName only to call GetMemberId when we can just compare id to -1
                int index = penum.GetMemberId(attrName);
                if (index.IsNone())
                {
                    continue;
                }

                mList.InitializeItem(index);
                float value = PhxUtil.kInvalidSingle;
                s.ReadAttribute(attrName, ref value);
                mList[index] = value;
            }
        }
Exemplo n.º 2
0
        protected override void ReadXmlNodes(KSoft.IO.XmlElementStream s, BXmlSerializerInterface xs)
        {
            var penum = mList.TypeValuesParams.kGetProtoEnumFromDB(xs.Database);

            foreach (XmlAttribute attr in s.Cursor.Attributes)
            {
                // The only attributes in this are actual member names so we don't waste time calling
                // penum.IsValidMemberName only to call GetMemberId when we can just compare id to -1
                int index = penum.GetMemberId(attr.Name);
                if (index == PhxLib.Util.kInvalidInt32)
                {
                    continue;
                }

                mList.InitializeItem(index);
                float value = PhxLib.Util.kInvalidSingle;
                s.ReadAttribute(attr.Name, ref value);
                mList[index] = value;
            }
        }