Exemplo n.º 1
0
        public void promoteCompetitorToFinal(IHeatedCompetitor Competitor)
        {
            // Do not have to promote this competitor as they are already in the final.
            if (Competitor.isInFinal( ))
            {
                return;
            }

            if (!this.isEventFull( ))
            {
                if (this.EnteredCompetitors.Contains((ACompetitor)Competitor))
                {
                    if (((ACompetitor)Competitor).Result != null)
                    {
                        ((IHeatedCompetitor)Competitor).promoteToFinal( );
                    }
                    else
                    if (((IndividualTimedFinalEvent)Competitor.CompetingIn).HeatRunAsFinal)
                    {
                        ((IHeatedCompetitor)Competitor).promoteToFinal( );
                    }
                    else
                    {
                        throw new Exception("This competitor doesn't have a result in a heat so can not be promoted to the final.");
                    }
                }
                else
                {
                    throw new ArgumentException("This competitor is not in one of this events heats");
                }
            }
            else
            {
                throw new ArgumentException("This event is full");
            }
        }
Exemplo n.º 2
0
 public AResult AddHeatResult(int Rank, IHeatedCompetitor Competitor, ResultValue resultValue)
 {
     return(base.addResult(Rank, (ACompetitor)Competitor, resultValue));
 }
Exemplo n.º 3
0
 public void dropFromFinal(IHeatedCompetitor Competitor)
 {
     ((IHeatedCompetitor)Competitor).demoteFromFinal();
 }