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]); } }
void IRailPoolable <RailEvent> .Allocated() { DataSerializer = new RailEventDataSerializer(this); }