Beispiel #1
0
        public static SeasonCompetitionConfig CreateMediumSeasonConfig(League league, List <Team> teamList, List <CompetitionConfig> parents, int?startingDay, int order)
        {
            var seasonConfig = new SeasonCompetitionConfig("Regular Season", league, startingDay, order, null, 1, null, null, null, null, null, null);

            seasonConfig.GameRules = new GameRules("Season Rules", true, 1, 3, 120, true);

            seasonConfig.Parents = parents;

            var drNhl = new SeasonDivisionRule(seasonConfig, "NHL", null, 1, 1, null, 1, null);

            seasonConfig.DivisionRules = new List <SeasonDivisionRule>()
            {
                drNhl
            };

            seasonConfig.ScheduleRules = new List <SeasonScheduleRule>()
            {
                new SeasonScheduleRule(seasonConfig, null, drNhl, null, null, 3, false, 1, null),
            };

            var seasonTeamRules = new List <SeasonTeamRule>()
            {
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Ottawa").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Toronto").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Calgary").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Montreal").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Edmonton").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Vancouver").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Winnipeg").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Quebec").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Hamilton").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Halifax").First(), drNhl, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Victoria").First(), drNhl, 1, null),
            };

            drNhl.Teams = seasonConfig.GetTeamsInDivision("NHL").ToList();

            seasonConfig.TeamRules = seasonTeamRules;

            league.CompetitionConfigs.Add(seasonConfig);

            return(seasonConfig);
        }
Beispiel #2
0
        public static SeasonCompetitionConfig CreateLargeSeasonConfiguration(League league, List <Team> teamList, List <CompetitionConfig> parents, int?startingDay, int order)
        {
            var seasonConfig = new SeasonCompetitionConfig("Regular Season", league, startingDay, order, null, 1, null, null, null, null, null, null);

            seasonConfig.GameRules = new GameRules("Season Rules", true, 1, 3, 120, true);

            seasonConfig.Parents = parents;

            var drNhl      = new SeasonDivisionRule(seasonConfig, "NHL", null, 1, 1, null, 1, null);
            var drWestern  = new SeasonDivisionRule(seasonConfig, "Western", drNhl, 2, 1, null, 1, null);
            var drEastern  = new SeasonDivisionRule(seasonConfig, "Eastern", drNhl, 2, 1, null, 1, null);
            var drWest     = new SeasonDivisionRule(seasonConfig, "West", drWestern, 3, 1, null, 1, null);
            var drEast     = new SeasonDivisionRule(seasonConfig, "East", drEastern, 3, 2, null, 1, null);
            var drCentral  = new SeasonDivisionRule(seasonConfig, "Central", drWestern, 3, 3, null, 1, null);
            var drAtlantic = new SeasonDivisionRule(seasonConfig, "Atlantic", drEastern, 3, 4, null, 1, null);
            var drPacific  = new SeasonDivisionRule(seasonConfig, "Pacific", drWestern, 3, 5, null, 1, null);
            var drSouth    = new SeasonDivisionRule(seasonConfig, "South", drEastern, 3, 6, null, 1, null);


            seasonConfig.DivisionRules = new List <SeasonDivisionRule>()
            {
                drNhl, drWestern, drEastern, drWest, drEast, drCentral, drAtlantic, drPacific, drSouth
            };

            seasonConfig.ScheduleRules = new List <SeasonScheduleRule>()
            {
                new SeasonScheduleRule(seasonConfig, null, drNhl, null, null, 1, false, 1, null),
            };

            var seasonTeamRules = new List <SeasonTeamRule>()
            {
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Ottawa").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Toronto").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Buffalo").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Penguins").First(), drEast, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Flyers").First(), drEast, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Montreal").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Quebec").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "New Jersey").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Rangers").First(), drAtlantic, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.NickName == "Islanders").First(), drAtlantic, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Detroit").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Nashville").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Winnipeg").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Minnesota").First(), drCentral, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Chicago").First(), drCentral, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Colorado").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Calgary").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Edmonton").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Las Vegas").First(), drWest, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Saskatoon").First(), drWest, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Vancouver").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Victoria").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Seattle").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "San Jose").First(), drPacific, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Los Angelas").First(), drPacific, 1, null),

                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Anaheim").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Tampa Bay").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Washington").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Florida").First(), drSouth, 1, null),
                new SeasonTeamRule(seasonConfig, teamList.Where(t => t.Name == "Atlanta").First(), drSouth, 1, null)
            };

            drEast.Teams     = seasonConfig.GetTeamsInDivision("East").ToList();
            drAtlantic.Teams = seasonConfig.GetTeamsInDivision("Atlantic").ToList();
            drCentral.Teams  = seasonConfig.GetTeamsInDivision("Central").ToList();
            drWest.Teams     = seasonConfig.GetTeamsInDivision("West").ToList();
            drPacific.Teams  = seasonConfig.GetTeamsInDivision("Pacific").ToList();
            drSouth.Teams    = seasonConfig.GetTeamsInDivision("South").ToList();

            seasonConfig.TeamRules = seasonTeamRules;

            league.CompetitionConfigs.Add(seasonConfig);

            return(seasonConfig);
        }