Exemplo n.º 1
0
        public CompPoints GetCompPoints(CompScore compScr)
        {
            CompPoints cPoints     = new CompPoints();
            int        Hcap        = Convert.ToInt32(compScr.PlayerHcap);
            string     teeColour   = compScr.TeeColour;
            int        courseID    = compScr.CourseID;
            int        compScoreID = compScr.CompScoreID;

            cPoints.CompScoreID = compScoreID;
            // Calculate the Points for each Hole
            cPoints.Hole1       = calculatePointsScore(Hcap, cInfo.GetHoleSI(1, courseID, teeColour), Convert.ToInt32(compScr.Hole1), cInfo.GetHolePar(1, courseID, teeColour), compScoreID, 1);
            cPoints.Hole2       = calculatePointsScore(Hcap, cInfo.GetHoleSI(2, courseID, teeColour), Convert.ToInt32(compScr.Hole2), cInfo.GetHolePar(2, courseID, teeColour), compScoreID, 2);
            cPoints.Hole3       = calculatePointsScore(Hcap, cInfo.GetHoleSI(3, courseID, teeColour), Convert.ToInt32(compScr.Hole3), cInfo.GetHolePar(3, courseID, teeColour), compScoreID, 3);
            cPoints.Hole4       = calculatePointsScore(Hcap, cInfo.GetHoleSI(4, courseID, teeColour), Convert.ToInt32(compScr.Hole4), cInfo.GetHolePar(4, courseID, teeColour), compScoreID, 4);
            cPoints.Hole5       = calculatePointsScore(Hcap, cInfo.GetHoleSI(5, courseID, teeColour), Convert.ToInt32(compScr.Hole5), cInfo.GetHolePar(5, courseID, teeColour), compScoreID, 5);
            cPoints.Hole6       = calculatePointsScore(Hcap, cInfo.GetHoleSI(6, courseID, teeColour), Convert.ToInt32(compScr.Hole6), cInfo.GetHolePar(6, courseID, teeColour), compScoreID, 6);
            cPoints.Hole7       = calculatePointsScore(Hcap, cInfo.GetHoleSI(7, courseID, teeColour), Convert.ToInt32(compScr.Hole7), cInfo.GetHolePar(7, courseID, teeColour), compScoreID, 7);
            cPoints.Hole8       = calculatePointsScore(Hcap, cInfo.GetHoleSI(8, courseID, teeColour), Convert.ToInt32(compScr.Hole8), cInfo.GetHolePar(8, courseID, teeColour), compScoreID, 8);
            cPoints.Hole9       = calculatePointsScore(Hcap, cInfo.GetHoleSI(9, courseID, teeColour), Convert.ToInt32(compScr.Hole9), cInfo.GetHolePar(9, courseID, teeColour), compScoreID, 9);
            cPoints.Hole10      = calculatePointsScore(Hcap, cInfo.GetHoleSI(10, courseID, teeColour), Convert.ToInt32(compScr.Hole10), cInfo.GetHolePar(10, courseID, teeColour), compScoreID, 10);
            cPoints.Hole11      = calculatePointsScore(Hcap, cInfo.GetHoleSI(11, courseID, teeColour), Convert.ToInt32(compScr.Hole11), cInfo.GetHolePar(11, courseID, teeColour), compScoreID, 11);
            cPoints.Hole12      = calculatePointsScore(Hcap, cInfo.GetHoleSI(12, courseID, teeColour), Convert.ToInt32(compScr.Hole12), cInfo.GetHolePar(12, courseID, teeColour), compScoreID, 12);
            cPoints.Hole13      = calculatePointsScore(Hcap, cInfo.GetHoleSI(13, courseID, teeColour), Convert.ToInt32(compScr.Hole13), cInfo.GetHolePar(13, courseID, teeColour), compScoreID, 13);
            cPoints.Hole14      = calculatePointsScore(Hcap, cInfo.GetHoleSI(14, courseID, teeColour), Convert.ToInt32(compScr.Hole14), cInfo.GetHolePar(14, courseID, teeColour), compScoreID, 14);
            cPoints.Hole15      = calculatePointsScore(Hcap, cInfo.GetHoleSI(15, courseID, teeColour), Convert.ToInt32(compScr.Hole15), cInfo.GetHolePar(15, courseID, teeColour), compScoreID, 15);
            cPoints.Hole16      = calculatePointsScore(Hcap, cInfo.GetHoleSI(16, courseID, teeColour), Convert.ToInt32(compScr.Hole16), cInfo.GetHolePar(16, courseID, teeColour), compScoreID, 16);
            cPoints.Hole17      = calculatePointsScore(Hcap, cInfo.GetHoleSI(17, courseID, teeColour), Convert.ToInt32(compScr.Hole17), cInfo.GetHolePar(17, courseID, teeColour), compScoreID, 17);
            cPoints.Hole18      = calculatePointsScore(Hcap, cInfo.GetHoleSI(18, courseID, teeColour), Convert.ToInt32(compScr.Hole18), cInfo.GetHolePar(18, courseID, teeColour), compScoreID, 18);
            cPoints.OutPoints   = cPoints.Hole1 + cPoints.Hole2 + cPoints.Hole3 + cPoints.Hole4 + cPoints.Hole5 + cPoints.Hole6 + cPoints.Hole7 + cPoints.Hole8 + cPoints.Hole9;
            cPoints.InPoints    = cPoints.Hole10 + cPoints.Hole11 + cPoints.Hole12 + cPoints.Hole13 + cPoints.Hole14 + cPoints.Hole15 + cPoints.Hole16 + cPoints.Hole17 + cPoints.Hole18;
            cPoints.TotalPoints = cPoints.OutPoints + cPoints.InPoints;

            return(cPoints);
        }