Пример #1
0
        /// <summary>
        /// Writes the data element into the given buffer (at its current position).
        /// </summary>
        /// <param name="buffer">The buffer where the data element should be deserialized into.</param>
        public void WriteData(RAMBuffer buffer)
        {
            buffer.WriteUInteger(NextUnitIdToPlace);

            buffer.WriteFloat(1.22f);

            ScenarioDataElementTools.AssertListLength(PlayerNames, 16);
            PlayerNames.ForEach(p => buffer.WriteString(p, 256));

            ScenarioDataElementTools.AssertListLength(PlayerNameDllIds, 16);
            PlayerNameDllIds.ForEach(p => buffer.WriteUInteger(p));

            ScenarioDataElementTools.AssertListLength(PlayerData, 16);
            PlayerData.ForEach(p => p.WriteData(buffer));

            buffer.WriteUInteger(Unknown1);
            buffer.WriteByte(0);
            buffer.WriteFloat(Unknown2);

            buffer.WriteShort((short)OriginalFileName.Length);
            buffer.WriteString(OriginalFileName);
        }