Example #1
0
        public override void Serialize(ref byte[] buffer, Pointer p, bool includeComponents)
        {
            BitPacker.AddPropertyBag(ref buffer, p, Properties);
            BitPacker.AddStatBag(ref buffer, p, Stats);
            BitPacker.AddInt(ref buffer, p, ID);

            base.Serialize(ref buffer, p, includeComponents);
        }
Example #2
0
        public override void Serialize(ref byte[] buffer, Pointer p, bool includeSubComponents)
        {
            // General match info
            BitPacker.AddInt(ref buffer, p, Owner);
            BitPacker.AddString(ref buffer, p, GameID.ToString());
            BitPacker.AddPropertyBag(ref buffer, p, Properties);

            // Players
            List <ICharacterInfo> players = AllPlayers;

            BitPacker.AddInt(ref buffer, p, players.Count);
            for (int i = 0; i < players.Count; i++)
            {
                ICharacterInfo ci = players[i];
                BitPacker.AddPropertyBag(ref buffer, p, ci.Properties);
                BitPacker.AddStatBag(ref buffer, p, ci.Stats);
                BitPacker.AddInt(ref buffer, p, ci.ID);
            }

            base.Serialize(ref buffer, p, includeSubComponents);
        }