コード例 #1
0
        public override void Write(BinaryWriter file)
        {
            base.Write(file);

            for (var i = 0; i < BufferParameters.Count; i++)
            {
                CVariant variable = BufferParameters[i];

                file.Write(variable.GetnameId());

                variable.Write(file);
            }
            file.Write((ushort)0);
        }
コード例 #2
0
        public override void Read(BinaryReader file, uint size)
        {
            base.Read(file, size);

            while (true)
            {
                var nameId = file.ReadUInt16();

                if (nameId == 0)
                {
                    break;
                }

                // read cvariant
                var      varname  = cr2w.Names[nameId].Str;
                CVariant cVariant = new CVariant(cr2w, BufferParameters, varname);
                cVariant.Read(file, 0);

                BufferParameters.AddVariableWithName(cVariant);
            }
        }