示例#1
0
        public Golfer ViewMemberAccount(int MemberNumber)
        {
            Golfers dataManager = new Golfers();
            var     Account     = dataManager.ViewMemberAccount(MemberNumber);

            return(Account);
        }
示例#2
0
        public List <Golfer> GetGolfers()
        {
            Golfers dataManager = new Golfers();
            var     Golfers     = dataManager.GetGolfers();

            return(Golfers);
        }
示例#3
0
        public Golfer GetGolfer(int MemberNumber)
        {
            Golfers dataManager = new Golfers();
            var     Account     = dataManager.GetGolfer(MemberNumber);

            return(Account);
        }
示例#4
0
        public bool ReviewMembershipApplication(Golfer golfer)
        {
            bool    Confirmation = false;
            Golfers dataManager  = new Golfers();

            Confirmation = dataManager.ReviewMembershipApplication(golfer);
            return(Confirmation);
        }
示例#5
0
        public void Test_CostOfSolution()
        {
            Golfers golfers = new Golfers(4, 4, 2);
            //shared_ptr<PSP> psp442(make_shared<PSP>(bench442));

            Solution sol442 = new Solution(golfers.Variable_Domain, ConfigurationProvider.Golfers_442_c0);

            Assert.That(golfers.solutionCost(sol442), Is.EqualTo(0));

            sol442 = new Solution(golfers.Variable_Domain, ConfigurationProvider.Golfers_442_c4);
            Assert.That(golfers.solutionCost(sol442), Is.EqualTo(4));

            Benchmark bench553 = new Golfers(5, 5, 4);
            Solution  sol553   = new Solution(bench553.Variable_Domain, ConfigurationProvider.Golfers_554_c0);

            Assert.That(bench553.solutionCost(sol553), Is.EqualTo(0));

            Benchmark bench662 = new Golfers(6, 6, 2);
            Solution  sol662   = new Solution(bench662.Variable_Domain, ConfigurationProvider.Golfers_662_c0);

            Assert.That(bench662.solutionCost(sol662), Is.EqualTo(0));
        }
示例#6
0
        public void AddPlayer(Player player, GolfRoundType golfRoundType, NineType?nineType)
        {
            var golfer = new Golfer()
            {
                Id      = Golfers.Count + 1,
                Name    = player.Name,
                IsAdmin = Golfers.Count == 0,
                Holes   = new List <Hole>()
            };

            if (golfRoundType == GolfRoundType.Eighteen || nineType == NineType.Front)
            {
                int iterator = 1;
                while (iterator <= (int)golfRoundType)
                {
                    golfer.Holes.Add(new Hole()
                    {
                        Id = iterator
                    });

                    iterator++;
                }
            }
            else
            {
                int iterator = 10;
                while (iterator <= 18)
                {
                    golfer.Holes.Add(new Hole()
                    {
                        Id = iterator
                    });

                    iterator++;
                }
            }

            Golfers.Add(golfer);
        }