Beispiel #1
0
        /// <summary>
        ///Creates a card object based on a number between 0 and 51
        /// </summary>
        public Card(int num)
        {
            //Assign the Suit of the card
            number = num;
            int findSuit = number / 13;

            switch (findSuit)
            {
            case 0:
                suit = CardSuit.SPADES;
                break;

            case 1:
                suit = CardSuit.HEARTS;
                break;

            case 2:
                suit = CardSuit.CLUBS;
                break;

            case 3:
                suit = CardSuit.DIAMONDS;
                break;
            }
            //Assign the Height
            int findHeight = number % 13;

            switch (findHeight)
            {
            case 0:
                height = CardHeight.DEUCE;
                break;

            case 1:
                height = CardHeight.THREE;
                break;

            case 2:
                height = CardHeight.FOUR;
                break;

            case 3:
                height = CardHeight.FIVE;
                break;

            case 4:
                height = CardHeight.SIX;
                break;

            case 5:
                height = CardHeight.SEVEN;
                break;

            case 6:
                height = CardHeight.EIGHT;
                break;

            case 7:
                height = CardHeight.NINE;
                break;

            case 8:
                height = CardHeight.TEN;
                break;

            case 9:
                height = CardHeight.JACK;
                break;

            case 10:
                height = CardHeight.QUEEN;
                break;

            case 11:
                height = CardHeight.KING;
                break;

            case 12:
                height = CardHeight.ACE;
                break;
            }
        }
Beispiel #2
0
    public void AssignMoveStruct(string type, string speed, string height, string strength, string name)
    {
        cardName = name;

        switch (type)
        {
        case "ATTACK":
            cardType = CardType.ATTACK;
            break;

        case "DEFEND":
            cardType = CardType.DEFEND;
            break;

        default:
            Debug.LogError("Unknown Move Type!");
            break;
        }
        switch (speed)
        {
        case "FAST":
            cardSpeed = CardSpeed.FAST;
            break;

        case "MEDIUM":
            cardSpeed = CardSpeed.MEDIUM;
            break;

        case "SLOW":
            cardSpeed = CardSpeed.SLOW;
            break;

        default:
            Debug.LogError("Unknown Move Speed!");
            break;
        }
        switch (height)
        {
        case "HIGH":
            cardHeight = CardHeight.HIGH;
            break;

        case "MID":
            cardHeight = CardHeight.MID;
            break;

        case "LOW":
            cardHeight = CardHeight.LOW;
            break;

        default:
            Debug.LogError("Unknown Move Height!");
            break;
        }
        switch (strength)
        {
        case "STRONG":
            cardStrength = CardStrength.STRONG;
            break;

        case "MODERATE":
            cardStrength = CardStrength.MODERATE;
            break;

        case "WEAK":
            cardStrength = CardStrength.WEAK;
            break;

        default:
            Debug.LogError("Unknown Move Strength!");
            break;
        }
    }