示例#1
0
        public void HandleTestResults(int vHealth)
        {
            bool   fail;
            double vDamage = ((1000 - vHealth) / 1000f) * 100;

            if (testType == 1 || testType == 2 || testType == 3)
            {
                if (speedFlags.Count > checkpoints.Count / 4 || vDamage > checkpoints.Count / 4)
                {
                    fail = true;
                }
                else
                {
                    fail = false;
                }
            }
            else if (testType == 6 || testType == 5 || testType == 4)
            {
                fail = vDamage > 0;
            }
            else
            {
                fail = true;
            }
            if (!fail)
            {
                License license = new License()
                {
                    PlayerId = testee.Id,
                    Type     = (LicenseType)testType
                };
                LicenseRepository.AddLicense(license);
            }
            DrivingTestManager.DisplayTestResults(this, testee, "C Class", speedFlags.Count, vDamage, fail);
        }
        public void CheckPlayerLicenses(Client player, int playerID)
        {
            List <License> licenses = LicenseRepository.GetPlayerLicenses(playerID);

            foreach (License license in licenses)
            {
                API.sendChatMessageToPlayer(player, license.Type.ToString());
            }
        }