public static List<PlayersEntity> BuildPairs(Guid tournamentId, PairsMatchType type, List<MetaPlayer> players, int numOfRounds) { IPairMatching matcher = PairsMatch.MatchPlayersFactory(type); List<PlayersEntity> playerPairs = matcher.Execute(players, numOfRounds); return playerPairs; }
public static List<PlayersEntity> BuildPairs(Guid tournamentId, PairsAlgorithmType type, PairsMatchType pairsMatchingType, int numOfRounds) { List<MetaPlayer> listPlayers = GetPlayers(tournamentId, type); List<PlayersEntity> pairs = BuildPairs(tournamentId, pairsMatchingType, listPlayers, numOfRounds); //match up return pairs; }
internal static IPairMatching MatchPlayersFactory(PairsMatchType type) { switch(type) { case PairsMatchType.Bracket: return new DefaultMatch(); case PairsMatchType.MultiGame: return new MultiMatch(); default: return new DefaultMatch(); } }
public static List<PlayersEntity> BuildPairs(Guid tournamentId, PairsAlgorithmType type, PairsMatchType pairsMatchingType) { return BuildPairs(tournamentId, type, pairsMatchingType, 1); }
//internal static void ScheduleGames(Guid orgId, Guid tournaId) //{ // //Get tourna startDate // DateTime startDate = new DateTime(); // using (TournaDataContext db = new TournaDataContext()) // { // startDate = db.Tournaments.Where(x => x.Id == tournaId) // .Select(y => y.StartDate) // .FirstOrDefault() ?? new DateTime(); // } // ScheduleGames(orgId, tournaId, startDate); //} internal static void ScheduleGames(Guid orgId, Guid tournaId, DateTime startDate, PairsMatchType matchType, PairsAlgorithmType pairAlgo) { TournamentInfo info = new TournamentInfo() { TournamentId = tournaId, OrganisationId = orgId, StartDate = startDate, MatchType = matchType, PairAlgo = pairAlgo }; ScheduleGames(info); }