コード例 #1
0
        public override void removeAthlete(Athlete Athlete)
        {
            if (Athlete == null)
            {
                return;
            }

            ACompetitor c = EnteredCompetitors.Where(e => e.isAthlete(Athlete)).FirstOrDefault();

            if (c != null)
            {
                this.removeCompetitor(c);
            }
        }
コード例 #2
0
        public override void removeAthlete(Athlete Athlete)
        {
            if (Athlete == null)
            {
                return;
            }

            Squad s = (Squad)EnteredCompetitors.Where(e => e.isAthlete(Athlete)).FirstOrDefault();

            if (s != null)
            {
                if (s.Competitor1 != null)
                {
                    if (s.Competitor1 == Athlete)
                    {
                        s.Competitor1 = null;
                    }
                }

                if (s.Competitor2 != null)
                {
                    if (s.Competitor2 == Athlete)
                    {
                        s.Competitor2 = null;
                    }
                }

                if (s.Competitor3 != null)
                {
                    if (s.Competitor3 == Athlete)
                    {
                        s.Competitor3 = null;
                    }
                }

                if (s.Competitor4 != null)
                {
                    if (s.Competitor4 == Athlete)
                    {
                        s.Competitor4 = null;
                    }
                }
            }

            if (s.isSquadEmpty())
            {
                this.removeCompetitor(s);
            }
        }