Esempio n. 1
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="copyFrom"></param>
        public AchievementInfo(AchievementInfo copyFrom)
        {
            Id       = string.Copy(copyFrom.Id);
            NumBytes = copyFrom.NumBytes;
            if (Data.Length < NumBytes)
            {
                Data = new byte[NumBytes];
            }

            Array.Copy(copyFrom.Data, Data, NumBytes);
        }
        internal override void InternalDeserialize(NetIncomingMessage lidgrenMsg)
        {
            base.InternalDeserialize(lidgrenMsg);

            AchievementsCount = lidgrenMsg.ReadInt32();
            if (Achievements.Length < AchievementsCount)
            {
                Achievements = new AchievementInfo[AchievementsCount];
            }


            for (var i = 0; i < AchievementsCount; i++)
            {
                if (Achievements[i] == null)
                {
                    Achievements[i] = new AchievementInfo();
                }

                Achievements[i].Deserialize(lidgrenMsg);
            }
        }