Esempio n. 1
0
File: Card.cs Progetto: HugoFang/Uno
    public static T Create <T>(ENUM_CARD_TYPE type) where T : Card
    {
        Card t = null;

        switch (type)
        {
        case ENUM_CARD_TYPE.NONE:
            break;

        case ENUM_CARD_TYPE.NUMBER:
            t = new Card_Number();
            break;

        case ENUM_CARD_TYPE.STOP:
            t = new Card_Stop();
            break;

        case ENUM_CARD_TYPE.FLIP:
            t = new Card_Flip();
            break;

        case ENUM_CARD_TYPE.DRAW2:
            t = new Card_DrawTwo();
            break;

        case ENUM_CARD_TYPE.WILD:
            t = new Card_Wild();
            break;

        case ENUM_CARD_TYPE.WILD_DRAW4:
            t = new Card_Wild4();
            break;

        default:
            break;
        }

        return(t as T);
    }
Esempio n. 2
0
 public CardDefinition(int index, int suite, int number)
 {
     Index  = index;
     Suite  = (Card_Suite)suite;
     Number = (Card_Number)number;
 }