Exemplo n.º 1
0
        public static Season NewSeason()
        {
            if (Seasons == null)
            {
                Seasons = new List <Season>();
            }

            var newSeason = new Season
            {
                Id = !Seasons.Any() ? 1 : Seasons.Max(s => s.Id) + 1
            };

            for (var division = 1; division <= GameData.Divisions; division++)
            {
                TeamStatsData.CreateDivisionData(newSeason.Id, division);
            }

            GameData.CurrentSeason = newSeason.Id;
            GameData.CurrentWeek   = 1;

            MatchData.CreateSeasonFixtures(newSeason.Id);

            Seasons.Add(newSeason);
            NewsData.AddNewsItem("New Season !!");
            TeamData.AutoSelectAllTeams();

            if (GameData.SkipToLastWeekOfSeason)
            {
                MatchData.PlayAllMatchesForSeason();
                GameData.CurrentWeek = GameData.WeeksInSeason;
                NewsData.AddNewsItem("Last week of season!");
            }

            return(newSeason);
        }
Exemplo n.º 2
0
        public static void EndofSeasonUpdates()
        {
            PromoteOrRelegateTeams();
            PlayerData.UnselectAllPlayers();

            var retiredPlayersList = PlayerData.PlayersAgeIncrease();

            NewsData.AddNewsItem(retiredPlayersList);

            TeamData.CashRewards();
            PlayerData.BoostRatings();
            AddNewPlayers();
        }
Exemplo n.º 3
0
        public static void AdvanceWeek()
        {
            var outOfContractDisplay = "Players out of contract :";
            var anyFlag = false;

            foreach (var player in Players.Where(p => p.Contract > 0))
            {
                player.Contract--;
                if (player.Contract == 0)
                {
                    anyFlag = true;
                    outOfContractDisplay += player.Name + " (" + player.Team + "),";
                }
            }
            if (anyFlag)
            {
                NewsData.AddNewsItem(outOfContractDisplay.TrimEnd(','));
            }
        }
Exemplo n.º 4
0
        private static void PromoteOrRelegateTeams()
        {
            var proNews = "Promoted: ";
            var relNews = "Relegated: ";

            foreach (var prorel in ProRelData.GetProRelInfoForSeason(GameData.CurrentSeason))
            {
                var team = TeamData.GetTeamById(prorel.TeamId);
                if (prorel.Status == "Relegated")
                {
                    team.DivisionId++;
                    relNews += team.Name + ",";
                }
                else
                {
                    team.DivisionId--;
                    proNews += team.Name + ",";
                }
            }
            proNews.TrimEnd(',');
            relNews.TrimEnd(',');
            NewsData.AddNewsItem(proNews);
            NewsData.AddNewsItem(relNews);
        }