Exemplo n.º 1
0
 public Round(GolfCourse course, int[] scorecard, int currentHole, int strokes)
 {
     Course      = course;
     Scorecard   = scorecard;
     CurrentHole = currentHole;
     Strokes     = strokes;
 }
Exemplo n.º 2
0
        public GolfCourseDB(GolfCourse course)
        {
            Name = course.GetCourseName();

            int[]  inputScorecard = course.GetScorecard();
            string scorecard      = "";

            for (int i = 0; i < inputScorecard.Length; i++)
            {
                scorecard += inputScorecard[i].ToString();
            }

            Scorecard = scorecard;
        }
Exemplo n.º 3
0
 public Round(GolfCourse course)
 {
     Course = course;
     if (Course.GetLength() == 9)
     {
         Scorecard = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     }
     else
     {
         Scorecard = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     }
     CurrentHole = 1;
     Strokes     = 0;
 }
Exemplo n.º 4
0
        public Round(RoundDB roundDB, GolfCourse course)
        {
            Course = course;

            if (roundDB.Size == 9)
            {
                Scorecard = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            }
            else
            {
                Scorecard = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            }

            Scorecard[0] = roundDB.ScoreOne;
            Scorecard[1] = roundDB.ScoreTwo;
            Scorecard[2] = roundDB.ScoreThree;
            Scorecard[3] = roundDB.ScoreFour;
            Scorecard[4] = roundDB.ScoreFive;
            Scorecard[5] = roundDB.ScoreSix;
            Scorecard[6] = roundDB.ScoreSeven;
            Scorecard[7] = roundDB.ScoreEight;
            Scorecard[8] = roundDB.ScoreNine;

            if (roundDB.Size == 18)
            {
                Scorecard[9]  = roundDB.ScoreTen;
                Scorecard[10] = roundDB.ScoreEleven;
                Scorecard[11] = roundDB.ScoreTwelve;
                Scorecard[12] = roundDB.ScoreThirteen;
                Scorecard[13] = roundDB.ScoreFourteen;
                Scorecard[14] = roundDB.ScoreFifteen;
                Scorecard[15] = roundDB.ScoreSixteen;
                Scorecard[16] = roundDB.ScoreSeventeen;
                Scorecard[17] = roundDB.ScoreEighteen;
            }

            CurrentHole = roundDB.CurrentHole;
            Strokes     = roundDB.Strokes;
        }