public Tournament(Tournament tournament) { Name = tournament.Name; Location = tournament.Location; Date = tournament.Date; foreach (var match in tournament.AllMatches) { Match newMatch = new Match(match); AllMatches.Add(newMatch); } TournamentId = tournament.TournamentId; }
public void CheckForMatches() { Traversed.Clear(); AllMatches.Clear(); for (int y = 0; y < Board.Rows; y++) { for (int x = 0; x < Board.Columns; x++) { PuzzleOrb orb = GetOrbWithIndex(new Index2D(x, y)); if (Traversed.Contains(orb)) { continue; } List <List <PuzzleOrb> > matchGroup = new List <List <PuzzleOrb> >(); TraverseOrb(orb, matchGroup); if (matchGroup.Count > 0) { List <PuzzleOrb> matchedOrbs = new List <PuzzleOrb>(); for (int i = 0; i < matchGroup.Count; i++) { for (int j = 0; j < matchGroup[i].Count; j++) { if (!matchedOrbs.Contains(matchGroup[i][j])) { matchedOrbs.Add(matchGroup[i][j]); } } } AllMatches.Add(matchedOrbs); } } } }
public static void AddMatch(TournamentGroupLogMatch match) { AllMatches.Add(match); }