public void SetDataFrom(RailCommandDataSerializer other) { if (command.GetType() != other.command.GetType()) { throw new ArgumentException( $"The instance to copy from is not for the same event type. Expected {command.GetType()}, got {other.command.GetType()}.", nameof(other)); } for (int i = 0; i < members.Count; ++i) { members[i].ApplyFrom(other.members[i]); } }
void IRailPoolable <RailCommand> .Allocated() { DataSerializer = new RailCommandDataSerializer(this); }