Exemple #1
0
        public void AddStandardCards()
        {
            var suitTypes = Enum.GetValues(typeof(Suit));
            var faceTypes = Enum.GetValues(typeof(Face));

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 13; j++)
                {
                    Playingcard card = new Playingcard(
                        (Suit)(suitTypes.GetValue(i)),
                        (Face)(faceTypes.GetValue(j)));
                    Add(card);
                }
            }
        }
Exemple #2
0
        public static Playingcard GetCard(PTMessage ptMsg)
        {
            Playingcard card = JsonUtility.FromJson <Playingcard>(ptMsg.GetData());

            return(card.isValid() ? card : null);
        }