Best way to represent game card class in C#

后端 未结 7 1892
难免孤独
难免孤独 2021-01-06 01:23

I use class Card which contains 2 enumerated properties (suite - hearts diamonds spades and clubs) and card value from 2 to A. And overrides ToString() method to returns som

7条回答
  •  失恋的感觉
    2021-01-06 01:35

    You can start enums with number (although it is preferred to start at zero)

    public enum Card
    {
       Two = 2,
       Three,
       Four,
       ...
    }
    

提交回复
热议问题