public ActorInstanceTransportCommand(ActorInstance actorInstance, Coordinate coordinate)
        {
            actorInstance.ThrowIfNull("actorInstance");

            _actorInstance = actorInstance;
            _coordinate = coordinate;
        }
        public ActorInstanceCreateCommand(Board board, ActorInstance actorInstance)
        {
            board.ThrowIfNull("board");
            actorInstance.ThrowIfNull("actorInstance");

            _board = board;
            _actorInstance = actorInstance;
        }
        public XElement Serialize(ActorInstance actorInstance, string elementName = "actorInstance")
        {
            actorInstance.ThrowIfNull("actorInstance");
            elementName.ThrowIfNull("elementName");

            return new XElement(
                elementName,
                CharacterSerializer.Instance.Serialize(actorInstance.Character),
                EventHandlerCollectionSerializer.Instance.Serialize(actorInstance.EventHandlerCollection),
                new XAttribute("id", actorInstance.Id),
                new XAttribute("name", actorInstance.Name),
                new XAttribute("description", actorInstance.Description),
                new XAttribute("actorId", actorInstance.ActorId),
                new XAttribute("boardId", actorInstance.BoardId),
                new XAttribute("coordinate", CoordinateSerializer.Instance.Serialize(actorInstance.Coordinate)));
        }
        public byte[] Serialize(ActorInstance actorInstance)
        {
            actorInstance.ThrowIfNull("actorInstance");

            var serializer = new CompactSerializer();

            serializer[0] = actorInstance.Id.ToByteArray();
            serializer[1] = Encoding.UTF8.GetBytes(actorInstance.Name);
            serializer[2] = Encoding.UTF8.GetBytes(actorInstance.Description);
            serializer[3] = actorInstance.ActorId.ToByteArray();
            serializer[4] = actorInstance.BoardId.ToByteArray();
            serializer[5] = CoordinateSerializer.Instance.Serialize(actorInstance.Coordinate);
            serializer[6] = CharacterSerializer.Instance.Serialize(actorInstance.Character);
            serializer[7] = EventHandlerCollectionSerializer.Instance.Serialize(actorInstance.EventHandlerCollection);

            return serializer.Serialize();
        }
        public ActorInstanceDestroyCommand(ActorInstance actorInstance)
        {
            actorInstance.ThrowIfNull("actorInstance");

            _actorInstance = actorInstance;
        }
        protected ActorInstanceMoveCommandBase(ActorInstance actorInstance)
        {
            actorInstance.ThrowIfNull("actorInstance");

            _actorInstance = actorInstance;
        }