public bool ExistsMatch(Guid homeTeam, Guid awayTeam, MatchStage stage) { return(this.matchesRepository.Get(x => ((homeTeam.Equals(x.HomeTeam) && awayTeam.Equals(x.AwayTeam)) || (awayTeam.Equals(x.HomeTeam) && homeTeam.Equals(x.AwayTeam))) && x.Stage == stage).Any()); }
public static bool SupportPenalties(this MatchStage matchStage) { return(matchStage >= MatchStage.Round16); }
public MatchStatus(UserMatchStatus userMatchStatus, MatchStage matchStage) { UserMatchStatus = userMatchStatus; MatchStage = matchStage; }
public Plan(string[] args) { var stageTree = new Stack <List <Stage> >(); stageTree.Push(new List <Stage>()); if (args.Count() < 1) { Console.WriteLine("Usage: ./Retina source.ret\n" + "You can also split the code over multiple files using the '-m' flag, in which case each\n" + "file corresponds to one line in a single source file (but may contain linefeeds.)\n" + "Usage: ./Retina -m pattern.rgx [replacement.rpl [pattern2.rgx replacement2.rpl [...]]]\n" + "Instead of a file name you can also use '-e pattern' or '-e replacement'.\n"); } else { List <string> sources = ReadSources(args); int i = 0; while (i < sources.Count) { string pattern = sources[i++]; Options options; string regex; ParsePattern(pattern, i < sources.Count, false, out options, out regex); for (int j = 0; j < options.OpenLoops; ++j) { stageTree.Push(new List <Stage>()); } Stage stage = null; switch (options.Mode) { case Modes.Match: stage = new MatchStage(options, regex); break; case Modes.Replace: string replacement = i < sources.Count ? sources[i++] : ""; stage = new ReplaceStage(options, regex, replacement); break; case Modes.Split: stage = new SplitStage(options, regex); break; case Modes.Grep: case Modes.AntiGrep: stage = new GrepStage(options, regex); break; case Modes.Transliterate: stage = new TransliterateStage(options, regex); break; default: throw new NotImplementedException(); } stageTree.Peek().Add(stage); for (int j = 0; j < options.CloseLoopsSilent.Count; ++j) { var loopBody = stageTree.Pop(); if (stageTree.Count == 0) { stageTree.Push(new List <Stage>()); } stageTree.Peek().Add(new LoopStage(loopBody, options.CloseLoopsSilent[j], options.CloseLoopsTrailingLinefeed[j])); } } while (stageTree.Count > 1) { var loopBody = stageTree.Pop(); stageTree.Peek().Add(new LoopStage(loopBody)); } Stages = stageTree.Pop(); if (Stages.Last().Silent == null) { Stages.Last().Silent = false; } } }