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]);
            }
        }
示例#2
0
 void IRailPoolable <RailCommand> .Allocated()
 {
     DataSerializer = new RailCommandDataSerializer(this);
 }