public SetSpriteCommand(SpriteLayer spriteLayer, Sprite sprite)
        {
            spriteLayer.ThrowIfNull("spriteLayer");
            sprite.ThrowIfNull("sprite");

            _spriteLayer = spriteLayer;
            _sprite = sprite;
        }
        public XElement Serialize(Sprite sprite, string elementName = "sprite")
        {
            sprite.ThrowIfNull("sprite");
            elementName.ThrowIfNull("elementName");

            return new XElement(
                elementName,
                CharacterSerializer.Instance.Serialize(sprite.Character),
                new XAttribute("coordinate", CoordinateSerializer.Instance.Serialize(sprite.Coordinate)));
        }
        public byte[] Serialize(Sprite sprite)
        {
            sprite.ThrowIfNull("sprite");

            var serializer = new CompactSerializer();

            serializer[0] = CoordinateSerializer.Instance.Serialize(sprite.Coordinate);
            serializer[1] = CharacterSerializer.Instance.Serialize(sprite.Character);

            return serializer.Serialize();
        }