Example #1
0
    public void SetCard(BoardGame.Card card)
    {
        if (null == card)
        {
            Log.Error("card is null");
            return;
        }

        switch (card.Type)
        {
        case BoardGame.Card.EType.Number:
            BoardGame.NumberCard numCard = card as BoardGame.NumberCard;
            setNumber(numCard.No);
            break;

        case BoardGame.Card.EType.Attack:
            setAttack();
            break;

        case BoardGame.Card.EType.Defense:
            setDefense();
            break;

        default:
            Log.Error("invalid card type");
            return;
        }

        Show();
    }
Example #2
0
    private void set(BoardGame.Card card)
    {
        switch (card.Type)
        {
        case BoardGame.Card.EType.Number:
            BoardGame.NumberCard numCard = card as BoardGame.NumberCard;
            setNumber(numCard.No);
            break;

        case BoardGame.Card.EType.Attack:
            setAttack();
            break;

        case BoardGame.Card.EType.Defense:
            setDefense();
            break;

        default:
            break;
        }
    }