Exemple #1
0
        /// <summary>
        /// create round object
        /// </summary>
        /// <param name="elem">contains required element for round</param>
        /// <param name="tenum">tournament dyscypline as enum</param>
        /// <param name="referees">dictionary of referees with id key</param>
        /// <param name="teams">dictionary of teams with id key</param>
        /// <returns>round object</returns>
        private static TRound.Round Round(RoundTempl elem, TEnum.TournamentDyscypline tenum, Dictionary <int, TPerson.Referee> referees, Dictionary <int, TTeam.ITeam> teams)
        {
            int j;

            TMatch.Match match;
            TRound.Round round = new TRound.Round(elem.RoundName, elem.Date);
            switch (tenum)
            {
            case TEnum.TournamentDyscypline.dodgeball:
                for (j = 0; j < elem.ListMatches.Count; j++)
                {
                    match = CreateMatch(elem.ListMatches[j], tenum, referees, teams);
                    ((TMatch.DodgeballMatch)match).SetResult(elem.ListMatches[j].winnerPlayersLeft);
                    round.AddMatch(match);
                }
                break;

            case TEnum.TournamentDyscypline.tugofwar:
                for (j = 0; j < elem.ListMatches.Count; j++)
                {
                    match = CreateMatch(elem.ListMatches[j], tenum, referees, teams);
                    ((TMatch.TugOfWarMatch)match).SetResult(elem.ListMatches[j].matchLength);
                    round.AddMatch(match);
                }
                break;

            case TEnum.TournamentDyscypline.volleyball:
                for (j = 0; j < elem.ListMatches.Count; j++)
                {
                    match = CreateVolleyballMatch(elem.ListMatches[j], tenum, referees, teams);
                    round.AddMatch(match);
                }

                break;

            default: throw new TournamentDyscyplineNotIdentify();
            }
            return(round);
        }
Exemple #2
0
 public TeamNotPlayingException(TRound.Round round, TTeam.ITeam team) : base(round)
 {
     this.team = team;
 }
Exemple #3
0
 public AlreadyPlayingInRoundException(TRound.Round round, TMatch.Match match, TTeam.ITeam team) : base(round)
 {
     this.match = match;
     this.team  = team;
 }
Exemple #4
0
 public RoundRuntimeException(TRound.Round round)
 {
     this.round = round;
 }