コード例 #1
0
ファイル: CM_Character.cs プロジェクト: OptimShi/aclogview
        public static PackObjPropertyCollection read(BinaryReader binaryReader)
        {
            PackObjPropertyCollection newObj = new PackObjPropertyCollection();

            newObj.i_iVersion = binaryReader.ReadUInt32();

            byte m_numBuckets  = binaryReader.ReadByte();
            byte m_numElements = binaryReader.ReadByte();

            for (byte i = 0; i < m_numElements; i++)
            {
                newObj.PropertyCollection.Add(BaseProperty.read(binaryReader));
            }

            return(newObj);
        }
コード例 #2
0
ファイル: CM_Character.cs プロジェクト: OptimShi/aclogview
        public static BaseProperty read(BinaryReader binaryReader)
        {
            BaseProperty newObj = new BaseProperty();

            newObj.key = (OptionProperty)binaryReader.ReadUInt32();
            switch (newObj.key)
            {
            case OptionProperty.Option_ActiveOpacity_Property:
                newObj.m_pcPropertyDesc   = (OptionProperty)binaryReader.ReadUInt32();
                newObj.floatPropertyValue = binaryReader.ReadSingle();
                break;

            case OptionProperty.Option_DefaultOpacity_Property:
                newObj.m_pcPropertyDesc   = (OptionProperty)binaryReader.ReadUInt32();
                newObj.floatPropertyValue = binaryReader.ReadSingle();
                break;

            case OptionProperty.Option_Placement_X_Property:
                newObj.m_pcPropertyDesc = (OptionProperty)binaryReader.ReadUInt32();
                newObj.intPropertyValue = binaryReader.ReadUInt32();
                break;

            case OptionProperty.Option_Placement_Y_Property:
                newObj.m_pcPropertyDesc = (OptionProperty)binaryReader.ReadUInt32();
                newObj.intPropertyValue = binaryReader.ReadUInt32();
                break;

            case OptionProperty.Option_Placement_Width_Property:
                newObj.m_pcPropertyDesc = (OptionProperty)binaryReader.ReadUInt32();
                newObj.intPropertyValue = binaryReader.ReadUInt32();
                break;

            case OptionProperty.Option_Placement_Height_Property:
                newObj.m_pcPropertyDesc = (OptionProperty)binaryReader.ReadUInt32();
                newObj.intPropertyValue = binaryReader.ReadUInt32();
                break;

            case OptionProperty.Option_Placement_Visibility_Property:
                newObj.m_pcPropertyDesc  = (OptionProperty)binaryReader.ReadUInt32();
                newObj.boolPropertyValue = binaryReader.ReadByte();
                break;

            case OptionProperty.Option_Placement_Title_Property:
                newObj.m_pcPropertyDesc = (OptionProperty)binaryReader.ReadUInt32();
                newObj.m_Override       = binaryReader.ReadByte();
                if (newObj.m_Override == 1)
                {
                    newObj.m_LiteralValue = Util.readUnicodeString(binaryReader);
                }
                else
                {
                    newObj.m_stringID = binaryReader.ReadUInt32();
                    newObj.m_tableID  = binaryReader.ReadUInt32();
                }
                // This variable is set in the StringInfo::Serialize function.
                newObj.bHasStrings = binaryReader.ReadUInt32();
                // These next two are set in the SerializeIntrusiveHashTable function.
                newObj.m_numBuckets  = binaryReader.ReadByte();
                newObj.m_numElements = binaryReader.ReadByte();
                break;

            case OptionProperty.Option_TextType_Property:
                newObj.m_pcPropertyDesc   = (OptionProperty)binaryReader.ReadUInt32();
                newObj.int64PropertyValue = binaryReader.ReadUInt64();
                break;

            case OptionProperty.Option_PlacementArray_Property:
                newObj.m_pcPropertyDesc        = (OptionProperty)binaryReader.ReadUInt32();
                newObj.num_properties          = binaryReader.ReadUInt32();
                newObj.PropertyCollectionValue = new List <BaseProperty>();
                for (uint i = 0; i < newObj.num_properties; i++)
                {
                    newObj.PropertyCollectionValue.Add(BaseProperty.read(binaryReader));
                }
                break;

            case OptionProperty.Option_Placement_Property:
                byte m_numBuckets  = binaryReader.ReadByte();
                byte m_numElements = binaryReader.ReadByte();
                newObj.PropertyCollectionValue = new List <BaseProperty>();
                for (byte i = 0; i < m_numElements; i++)
                {
                    newObj.PropertyCollectionValue.Add(BaseProperty.read(binaryReader));
                }
                break;
            }
            return(newObj);
        }