Beispiel #1
0
        public void CopyTo(FrameInfo dest)
        {
            if (dest == null)
            {
                return;
            }

            dest.FrameId        = FrameId;
            dest.RecvTickMS     = RecvTickMS;
            dest.ValidDataCount = ValidDataCount;

            if (dest.DataCollection == null)
            {
                dest.DataCollection = new List <RelayData>();
            }

            while (ValidDataCount > dest.DataCollection.Count)
            {
                dest.DataCollection.Add(new RelayData());
            }
            for (int i = 0; i < ValidDataCount; i++)
            {
                RelayData data = DataCollection[i];

                if (data != null)
                {
                    data.CopyTo(dest.DataCollection[i]);
                }
            }
        }
Beispiel #2
0
 public void CopyTo(RelayData dest)
 {
     dest.PlayerId   = PlayerId;
     dest.Flag       = Flag;
     dest.DelayMS    = DelayMS;
     dest.dataLength = dataLength;
     Array.Copy(data, dest.data, dataLength);
     dest.SequenceId = SequenceId;
 }
Beispiel #3
0
        public RelayData Clone()
        {
            RelayData clone = new RelayData();

            clone.PlayerId   = PlayerId;
            clone.Flag       = Flag;
            clone.DelayMS    = DelayMS;
            clone.dataLength = dataLength;
            Array.Copy(data, clone.data, dataLength);
            clone.SequenceId = SequenceId;
            return(clone);
        }
Beispiel #4
0
        public FrameInfo Clone()
        {
            FrameInfo clone = new FrameInfo();

            clone.FrameId    = FrameId;
            clone.RecvTickMS = RecvTickMS;
            for (int i = 0; i < DataCollection.Count; i++)
            {
                RelayData data = DataCollection[i];
                if (data != null)
                {
                    clone.DataCollection.Add(data.Clone());
                }
            }
            clone.ValidDataCount = ValidDataCount;
            return(clone);
        }