Exemple #1
0
        void displayTeam(ToolStrip ts, Team team)
        {
            if (Current.map == null)
            {
                displayPlayersByLineUp(ts, team, LineUp.Unknown);
                return;
            }

            displayPlayersByLineUp(ts, team, LineUp.Top);
            displayPlayersByLineUp(ts, team, LineUp.Middle);
            displayPlayersByLineUp(ts, team, LineUp.Bottom);
            displayPlayersByLineUp(ts, team, LineUp.JungleOrRoaming);
        }
Exemple #2
0
        void displayPlayersByLineUp(ToolStrip ts, Team team, LineUp lineUp)
        {
            bool separate = (ts.Items.Count != 0 && !(ts.Items[ts.Items.Count - 1] is ToolStripSeparator));

            foreach (Player p in team.Players)
                if (p.LineUp == lineUp)
                {
                    if (separate)
                    {
                        ToolStripSeparator tss = new ToolStripSeparator();
                        tss.Margin = new Padding(0, 5, 0, 5);
                        ts.Items.Add(tss);
                        separate = false;
                    }

                    ToolStripButton tsb = new ToolStripButton();
                    tsb.Text = p.Name;
                    switch (p.LineUp)
                    {
                        case LineUp.Top:
                        case LineUp.Middle:
                        case LineUp.Bottom:
                            tsb.Text += " (" + p.LineUp.ToString() + ")";
                            break;
                        case LineUp.JungleOrRoaming:
                            tsb.Text += " (" + "Jungle/Roaming" + ")";
                            break;
                    }
                    tsb.Font = UIFonts.tahoma9_75Bold;
                    tsb.BackColor = playerColorToColorBG(p.Color);
                    tsb.ForeColor = Color.White;
                    tsb.AutoToolTip = false;
                    tsb.Click += new EventHandler(playerToolStripButton_Click);
                    tsb.MouseDown += new MouseEventHandler(playerToolStripButton_MouseDown);
                    tsb.Tag = p;

                    if (p.Heroes.Count != 0)
                    {
                        string imagePath = DHLOOKUP.hpcUnitProfiles[p.GetMostUsedHero().Name, "Art"] as string;
                        tsb.Image = (imagePath != null) ? DHRC.GetImage(imagePath) : Properties.Resources.armor;
                    }
                    else
                        tsb.Image = Properties.Resources.armor;

                    tsb.ImageAlign = ContentAlignment.MiddleLeft;

                    ts.Items.Add(tsb);
                }
        }
Exemple #3
0
        void appendLineUpToExport(Team t, LineUp lineUp, bool vertical)
        {
            int count = 0;
            foreach (Player p in t.Players)
                if (p.LineUp == lineUp)
                {
                    count++;
                    if (count > 1)
                    {
                        if (vertical)
                            UIRichText.Default.AddText("\n");
                        else
                            UIRichText.Default.AddText(" + ");
                    }

                    Hero h = p.GetMostUsedHero();

                    string tag = getHeroTag(h.Name);

                    dcUsedHeroTags[tag] = h.Name;

                    UIRichText.Default.AddText(tag);

                    if (includeNamesCB.Checked && namesCmbB.SelectedIndex != -1)
                        UIRichText.Default.AddText(" " + getHeroNames(h.Name, namesCmbB.SelectedIndex));

                    UIRichText.Default.AddText(" " + p.Name);
                    if (vertical) UIRichText.Default.AddText("(" + getLaneName(lineUp) + ")");
                }
        }
Exemple #4
0
        List<int> GetListOfAlliedHeroes(Team team)
        {
            List<int> heroes = new List<int>(team.Players.Count);

            foreach (Player p in team.Players)
            {
                Hero h = p.GetMostUsedHero();
                if (h != null) heroes.Add(h.ObjectId);
            }

            return heroes;
        }
Exemple #5
0
        string getHorzLineUp(Team t, LineUp lineUp)
        {
            string result = string.Empty;
            int count = 0;
            foreach (Player p in t.Players)
                if (p.LineUp == lineUp)
                {
                    count++;
                    if (count > 1) result+= " + ";

                    Hero h = p.GetMostUsedHero();

                    string tag = getHeroTag(h.Name);

                    dcUsedHeroTags[tag] = h.Name;

                    result += tag;
                    result+= " " + p.Name;
                }

            return result;
        }
Exemple #6
0
 private Team GetTeamByNo(int teamNo)
 {
     foreach (Team team in teams)
         if (team.TeamNo == teamNo)
             return team;
     Team t = new Team(teamNo);
     teams.Add(t);
     return t;
 }