コード例 #1
0
ファイル: Player.cs プロジェクト: R1zzo23/SportsAgencyTycoon
        public Player(Random rnd, int id, Sports sport, int age)
        {
            random     = rnd;
            Id         = id;
            Sport      = sport;
            PlayerType = DeterminePlayerType(Sport);
            DepthChart = 0;
            IsStarter  = false;

            FirstName = randomFirstName(rnd);
            LastName  = randomLastName(rnd);
            FullName  = FirstName.ToString() + " " + LastName.ToString();

            CurrentSkill   = rnd.Next(25, 76);
            PotentialSkill = AssignPotential(rnd, age, CurrentSkill);

            Greed                 = rnd.Next(0, 101);
            Lifestyle             = rnd.Next(0, 101);
            Loyalty               = rnd.Next(0, 101);
            PlayForTitleContender = rnd.Next(0, 101);

            WillingToNegotiate = true;
            MemberOfAgency     = false;

            Age        = age;
            BirthMonth = (Months)rnd.Next(0, 12);

            BirthWeek = rnd.Next(1, 6);
            if (BirthWeek == 5)
            {
                if (((int)BirthMonth + 1) % 3 == 0)
                {
                    BirthWeek = 5;
                }
                else
                {
                    BirthWeek = 4;
                }
            }

            Birthday = CreateBirthday(BirthMonth, BirthWeek);

            Popularity            = DeterminePopularity(CurrentSkill, PotentialSkill, Age);
            PopularityDescription = DescribePopularity(Popularity);
            PopularityString      = EnumToString(PopularityDescription.ToString());

            CareerEarnings = 0;
        }