C# - Standard 52 card deck I made a 52 standard deck generator for practicing my C#. Just to let you know I am using the unity editor.
I would your feedback as to whether my code is good/bad or whatever you may desire.
using System;
using System.Collections.Generic;
using UnityEngine;

public class Standard52Deck {
    List&lt;Card&gt; deck = new List&lt;Card&gt;();

    enum Ranks {
        Ace,
        Two,
        Three,
        Four,
        Five,
        Six,
        Seven,
        Eight,
        Nine,
        Ten,
        Jack,
        Queen,
        King
    }

    enum Suits {
        Hearts,
        Spades,
        Clubs,
        Diamonds,
    }

    class Card {
        readonly Ranks rank;
        readonly Suits suit;

        public Card(Ranks rank, Suits suit) {
            this.rank = rank;
            this.suit = suit;
        }

        public override string ToString() {
            return $&quot;{rank} of {suit}&quot;;
        }
    }

    IEnumerable&lt;Card&gt; GetSortedCardsBySuits() {
        var rankCount = Enum.GetValues(typeof(Ranks));
        var suitCount = Enum.GetValues(typeof(Suits));
        var deckCount = rankCount.Length * suitCount.Length;

        var index = 0;
        var rankIteration = 0;

        while (index &lt; deckCount) {
            var rank = (Ranks)(index % 13);
            if (rank == 0 &amp;&amp; index != 0) {
                rankIteration++;
            }
            var suit = (Suits)(rankIteration);

            index++;
            yield return new Card(rank, suit);
        }
    }

    void CreateSortedCards() {
        foreach (var card in GetSortedCardsBySuits()) {
            deck.Add(card);
        }
    }

    void Start() {
        CreateSortedCards();
    }
}
class Card {
    readonly Ranks rank;
    readonly Suits suit;
    // ...
}

In this type definition, there is a grammatical mismatch: Ranks rank has a plural type name but a singular variable name.
The types Ranks and Suits should be renamed to Rank and Suit, to make the code more consistent.