/// <summary>
 ///  Checks if <paramref name="other"/> is equal to this sprite selection.
 /// </summary>
 /// <param name="other">The other sprite selection to compare to this sprite selection.</param>
 /// <returns>True if the other sprite selection is equal to this sprite selection.</returns>
 public bool Equals(IReadOnlySpriteSelection other)
 {
     return(GameId == other.GameId &&
            CharacterId == other.CharacterId &&
            Lighting == other.Lighting &&
            Distance == other.Distance &&
            Pose == other.Pose &&
            Blush == other.Blush &&
            GroupPartIds.SequenceEqual(other.GroupPartIds) &&
            GroupPartFrames.SequenceEqual(other.GroupPartFrames));
 }
        /// <summary>
        ///  Constructs the an immutable copy of the sprite selection.
        /// </summary>
        /// <param name="spriteSelection">The sprite selection to make a copy of.</param>
        public ImmutableSpriteSelection(IReadOnlySpriteSelection spriteSelection)
        {
            GameId      = spriteSelection.GameId;
            CharacterId = spriteSelection.CharacterId;

            Lighting = spriteSelection.Lighting;
            Distance = spriteSelection.Distance;
            Pose     = spriteSelection.Pose;
            Blush    = spriteSelection.Blush;

            GroupPartIds    = Array.AsReadOnly(spriteSelection.GroupPartIds.ToArray());
            GroupPartFrames = Array.AsReadOnly(spriteSelection.GroupPartFrames.ToArray());
        }
        /// <summary>
        ///  Constructs the an observable copy of the sprite selection.
        /// </summary>
        /// <param name="spriteSelection">The sprite selection to make a copy of.</param>
        public ObservableSpriteSelection(IReadOnlySpriteSelection spriteSelection)
        {
            GameId      = spriteSelection.GameId;
            CharacterId = spriteSelection.CharacterId;

            Lighting = spriteSelection.Lighting;
            Distance = spriteSelection.Distance;
            Pose     = spriteSelection.Pose;
            Blush    = spriteSelection.Blush;

            GroupPartIds    = new ObservableArray <int>(spriteSelection.GroupPartIds);
            GroupPartFrames = new ObservableArray <int>(spriteSelection.GroupPartFrames);
        }
 /// <summary>
 ///  Constructs the sprite draw info with the specified information.<para/>
 ///  The passed arrays must not be used elsewhere.
 /// </summary>
 /// <param name="selection">The sprite selection that created this draw info.</param>
 /// <param name="game">The game the character is being drawn from.</param>
 /// <param name="character">The character being drawn.</param>
 /// <param name="drawParts">The sprite parts draw info.</param>
 /// <param name="spriteParts">The actual sprite parts used.</param>
 /// <param name="totalSize">The total size of the sprite.</param>
 /// <param name="origin">The draw origin of the sprite.</param>
 /// <param name="expand">True if the sprite was created with the expand setting.</param>
 internal SpriteDrawInfo(IReadOnlySpriteSelection selection,
                         GameInfo game,
                         CharacterInfo character,
                         SpritePartDrawInfo[] drawParts,
                         ISpritePart[] spriteParts,
                         Point2I totalSize,
                         Point2I origin,
                         bool expand)
 {
     Selection   = selection.ToImmutable();
     Game        = game;
     Character   = character;
     DrawParts   = Array.AsReadOnly(drawParts);
     SpriteParts = Array.AsReadOnly(spriteParts);
     TotalSize   = totalSize;
     Origin      = origin;
     Expand      = expand;
 }
 /// <summary>
 ///  Gets the sprite selections's Id for this category.
 /// </summary>
 /// <param name="selection">The selection to get the Id from.</param>
 /// <returns>The selection's Id.</returns>
 public object GetId(IReadOnlySpriteSelection selection) => GetSelectionId(selection);