public ChampionshipTeamResult[] getOverallSores()
        {
            List <ChampionshipTeamResult> CTRs = new List <ChampionshipTeamResult>();

            List <ScoringTeam> STs = new List <ScoringTeam>();

            foreach (Team t in listAllTeams())
            {
                ChampionshipTeamResult stA = new ChampionshipTeamResult("A")
                {
                    Team = t
                };
                ChampionshipTeamResult stB = new ChampionshipTeamResult("B")
                {
                    Team = t
                };

                CTRs.Add(stA);
                CTRs.Add(stB);
            }

            foreach (AEvent Event in listAllEvents())
            {
                STs.AddRange(Event.getScoringTeams());
            }

            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "A").ToArray(), STs.Where(p => p.ScoringTeamName == "A").ToArray());
            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "B").ToArray(), STs.Where(p => p.ScoringTeamName == "B").ToArray());

            return(CTRs.ToArray());
        }
        public ChampionshipTeamResult[] getOverallSores(Group[] Groups)
        {
            List <ChampionshipTeamResult> CTRs = new List <ChampionshipTeamResult>();

            List <ScoringTeam> STs = new List <ScoringTeam>();

            foreach (Team t in listAllTeams( ))
            {
                ChampionshipTeamResult stA = new ChampionshipTeamResult("A")
                {
                    Team = t
                };
                ChampionshipTeamResult stB = new ChampionshipTeamResult("B")
                {
                    Team = t
                };

                foreach (Group g in Groups)
                {
                    stA.Description += g.Name + " ";
                    stB.Description += g.Name + " ";
                }

                stA.Description = stA.Description.Trim( );
                stB.Description = stB.Description.Trim( );

                CTRs.Add(stA);
                CTRs.Add(stB);
            }

            // only get results in this age group
            foreach (AEvent Event in listAllEvents( ))
            {
                bool inGroup = true;

                foreach (Group g in Groups)
                {
                    if (!Event.hasGroup(g))
                    {
                        inGroup = false;
                        break;
                    }
                }

                if (!inGroup)
                {
                    continue;
                }

                STs.AddRange(Event.getScoringTeams( ));
            }

            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "A").ToArray( ), STs.Where(p => p.ScoringTeamName == "A").ToArray( ));
            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "B").ToArray( ), STs.Where(p => p.ScoringTeamName == "B").ToArray( ));

            return(CTRs.ToArray( ));
        }
        public ChampionshipTeamResult[] getOverallSores(string AgeGroup)
        {
            List <ChampionshipTeamResult> CTRs = new List <ChampionshipTeamResult>();

            List <ScoringTeam> STs = new List <ScoringTeam>();

            foreach (Team t in listAllTeams())
            {
                ChampionshipTeamResult stA = new ChampionshipTeamResult("A")
                {
                    Team = t
                };
                ChampionshipTeamResult stB = new ChampionshipTeamResult("B")
                {
                    Team = t
                };

                CTRs.Add(stA);
                CTRs.Add(stB);
            }

            // only get results in this age group
            foreach (AEvent Event in listAllEvents())
            {
                if (Event.customFieldExists("AgeGroup"))
                {
                    if (Event.getValue("AgeGroup").ToString() == AgeGroup)
                    {
                        STs.AddRange(Event.getScoringTeams());
                    }
                }
            }

            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "A").ToArray(), STs.Where(p => p.ScoringTeamName == "A").ToArray());
            ChampionshipTeamResult.assignPointsAndRanks(CTRs.Where(p => p.ScoringTeamName == "B").ToArray(), STs.Where(p => p.ScoringTeamName == "B").ToArray());

            return(CTRs.ToArray());
        }