Esempio n. 1
0
        public void SetDataFrom(RailEventDataSerializer other)
        {
            if (eventInstance.GetType() != other.eventInstance.GetType())
            {
                throw new ArgumentException(
                          $"The instance to copy from is not for the same event type. Expected {eventInstance.GetType()}, got {other.eventInstance.GetType()}.",
                          nameof(other));
            }

            for (int i = 0; i < members.Count; ++i)
            {
                members[i].ApplyFrom(other.members[i]);
            }
        }
Esempio n. 2
0
 void IRailPoolable <RailEvent> .Allocated()
 {
     DataSerializer = new RailEventDataSerializer(this);
 }