예제 #1
0
        public string RoundLabel(ChallongeMatch match)
        {
            if (match.Round == MaxRound)
            {
                return("Grand Finals");
            }
            if (match.Round == MaxRound - 1)
            {
                return("Winners Finals");
            }
            if (match.Round == MaxRound - 2)
            {
                return("Winners Semifinals");
            }
            if (match.Round == MinRound)
            {
                return("Losers Finals");
            }
            if (match.Round == MinRound + 1)
            {
                return("Losers Semifinals");
            }

            return(string.Format("{0} Round {1}", match.Round > 0 ? "Winners" : "Losers", Math.Abs(match.Round)));
        }
예제 #2
0
        public string AssignNextAvailable(ChallongeMatch match)
        {
            if (Stations.ContainsValue(match) || !Stations.Values.Any(v => v == null))
            {
                return(null);
            }

            string stationName;

            if (ExcludeStreamTVsFromAutoAssign)
            {
                stationName = Stations.First(s => s.Value == null && !s.Key.ToLower().Contains("stream")).Key;
            }
            else
            {
                stationName = Stations.First(s => s.Value == null).Key;
            }

            if (AssignMatch(stationName, match))
            {
                return(stationName);
            }
            else
            {
                return(null);
            }
        }
예제 #3
0
        public bool AssignMatch(string stationName, ChallongeMatch match)
        {
            if (!Stations.ContainsKey(stationName) || Stations.ContainsValue(match) || Stations[stationName] != null)
            {
                return(false);
            }

            Stations[stationName] = match;
            return(true);
        }
예제 #4
0
        public string UnassignMatch(ChallongeMatch match)
        {
            if (!Stations.ContainsValue(match))
            {
                return(null);
            }

            var stationName = Stations.Single(s => s.Value == match).Key;

            if (UnassignMatch(stationName))
            {
                return(stationName);
            }
            else
            {
                return(null);
            }
        }