Exemple #1
0
        private void AssignNumber(int numberToAssing)
        {
            number = numberToAssing;
            switch (number)
            {
            case 2:
                ballEnum = BallColors.Blue;
                break;

            case 4:
                ballEnum = BallColors.Yellow;
                break;

            case 8:
                ballEnum = BallColors.Green;
                break;

            case 16:
                ballEnum = BallColors.Purple;
                break;

            case 32:
                ballEnum = BallColors.Brown;
                break;

            case 64:
                ballEnum = BallColors.White;
                break;

            case 128:
                ballEnum = BallColors.Cyan;
                break;

            case 256:
                ballEnum = BallColors.Orange;
                break;

            case 512:
                ballEnum = BallColors.Gray;
                break;

            case 1024:
                ballEnum = BallColors.Indigo;
                break;

            case 2048:
                ballEnum = BallColors.Red;
                break;
            }
            UpdateSelf();
        }
Exemple #2
0
    public static Color get_color(BallColors color)
    {
        switch (color)
        {
        case BallColors.RED: {
            return(Color.red);
        }

        case BallColors.GREEN: {
            return(Color.green);
        }

        case BallColors.BLUE: {
            return(Color.blue);
        }

        case BallColors.YELLOW: {
            return(Color.yellow);
        }
        }
        return(Color.black);
    }