Example #1
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="copyFrom"></param>
        public ContractInfo(ContractInfo copyFrom)
        {
            ContractGuid = copyFrom.ContractGuid;
            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);

            ContractCount = lidgrenMsg.ReadInt32();
            if (Contracts.Length < ContractCount)
            {
                Contracts = new ContractInfo[ContractCount];
            }


            for (var i = 0; i < ContractCount; i++)
            {
                if (Contracts[i] == null)
                {
                    Contracts[i] = new ContractInfo();
                }

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