private void TeamsAddTeam_Click(object sender, RoutedEventArgs e)
        {
            PotentialTeam pt = (sender as Button).Tag as PotentialTeam;
            TeamData      td = new TeamData(pt);

            int insertIndex = 0;

            for (; insertIndex < registeredTeams.Count; ++insertIndex)
            {
                if (td.TeamRankingPoints < registeredTeams[insertIndex].TeamRankingPoints)
                {
                    break;
                }
            }

            registeredTeams.Insert(insertIndex, td);

            foundTeams.Remove(pt);
        }
Esempio n. 2
0
        void ImportTeams(TournamentData importedData, DivisionData divisionData, PoolData poolData, XmlNode node)
        {
            foreach (XmlNode teamDataNode in node.ChildNodes)
            {
                TeamData teamData = new TeamData();

                foreach (XmlNode playerDataNode in teamDataNode.FirstChild.FirstChild.ChildNodes)
                {
                    if (playerDataNode.Name == "PlayerData")
                    {
                        RegisteredPlayer newPlayer = new RegisteredPlayer();

                        if (tournamentData.FindOrAddImportedRegisterPlayer(int.Parse(playerDataNode.FirstChild.FirstChild.Value), ref newPlayer))
                        {
                            teamData.players.Add(newPlayer);

                            importedData.AddRegisteredPlayer(newPlayer);
                        }
                    }
                }

                poolData.teamList.teams.Add(teamData);

                bool bNewTeam = true;
                foreach (TeamData td in divisionData.teamList.teams)
                {
                    if (td.Equals(teamData))
                    {
                        bNewTeam = false;
                        break;
                    }
                }

                if (bNewTeam)
                {
                    divisionData.teamList.teams.Add(teamData);
                }
            }
        }
Esempio n. 3
0
        private void PoolsUpdateTeamList()
        {
            SetTeamsInBaseSeedingOrder();

            ObservableCollection <TeamData> tempList = new ObservableCollection <TeamData>();

            foreach (TeamData td in poolsAllTeamsForDivision)
            {
                tempList.Add(null);
            }

            for (int i = 0; i < poolsAllTeamsForDivision.Count; ++i)
            {
                TeamData td = poolsAllTeamsForDivision[i];

                if (td.IsMovedForPoolSeeding)
                {
                    tempList[td.WildCardIndex] = td;

                    poolsAllTeamsForDivision.RemoveAt(i);

                    --i;
                }
            }

            foreach (TeamData orgTd in poolsAllTeamsForDivision)
            {
                for (int i = 0; i < tempList.Count; ++i)
                {
                    if (tempList[i] == null)
                    {
                        tempList[i] = orgTd;
                        break;
                    }
                }
            }

            poolsAllTeamsForDivision = tempList;
        }
        private void PoolItemsControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            TeamData td = (sender as Border).Tag as TeamData;

            if (bEnableRankPicking)
            {
                int curTeamRank = teamsRank[teams.IndexOf(td)];

                if (curTeamRank == 0)
                {
                    teamsRank[teams.IndexOf(td)] = nextTeamRank;

                    ++nextTeamRank;
                }

                return;
            }

            if (teamsRank.Count > 0)
            {
                return;
            }

            parentWindow.OverlayTeamData = td;
            Point offset = e.GetPosition(sender as Border);

            parentWindow.OverlayTeamDataOffset = offset;

            td.OverlayDragState = EOverlayTeamDataState.DragFrom;

            parentWindow.OverlayCanvas_MouseLeftButtonDown(sender, e);

            //teams.Remove(td);

            futureTeamData       = td;
            currentTeamDataIndex = teams.IndexOf(td);
        }
Esempio n. 5
0
 bool Equals(TeamData other)
 {
     return(PlayerNames == other.PlayerNames);
 }
 private void ClearFutureData()
 {
     RemoveFutureTeam();
     futureTeamData      = null;
     futureTeamDataIndex = INVALID_TEAM_INDEX;
 }
        private void TeamsRemoveTeam_Click(object sender, RoutedEventArgs e)
        {
            TeamData td = (sender as Button).Tag as TeamData;

            registeredTeams.Remove(td);
        }