예제 #1
0
        private void AddTemplateToPool(string template, int id)
        {
            int x = 3;
            int y = 3;

            // Set up the template display:
            TemplateDisplay td = new TemplateDisplay();

            td.SetTemplateInformation(template);

            if (id > 0)
            {
                y = PoolTemplates[id - 1].Bottom + 3;
            }
            td.Location         = new Point(x, y);
            td.SkillInfoDisplay = SkillInfoDisplay;

            PoolTemplates.Add(td);
            __PoolContainer.Controls.Add(td);

            // Set up the button display for the template:
            Button b = new Button();

            b.Text      = "Save";
            b.Visible   = false;
            b.Enabled   = false;
            b.Tag       = id;
            b.Click    += SaveTemplateInPool_Click;
            x          += 3 + td.Width;
            b.Location  = new Point(x, y);
            b.Height    = td.Height;
            b.BackColor = SystemColors.Control;

            PoolButtons.Add(b);
            __PoolContainer.Controls.Add(b);
        }
예제 #2
0
        private void DisplayDraftHand(List <string> hand)
        {
            // Clear the current set of draft hand stuff:
            __DraftHandContainer.Controls.Clear();
            DraftHandButtons.Clear();
            DraftHandTemplates.Clear();

            // OK, let's make some stuff happen!
            int y = 3;

            for (int i = 0; i < hand.Count; ++i)
            {
                // Set up the template display for this draft hand:
                TemplateDisplay td = new TemplateDisplay();
                td.SetTemplateInformation(hand[i]);
                td.Location         = new Point(3, y);
                td.SkillInfoDisplay = SkillInfoDisplay;

                DraftHandTemplates.Add(td);
                __DraftHandContainer.Controls.Add(td);

                // Now add the pick buttons:
                Button b = new Button();
                b.Text      = "Pick!";
                b.Height    = td.Height;
                b.Location  = new Point(td.Right + 3, y);
                b.Tag       = i;
                b.Click    += PickTemplate_Click;
                b.BackColor = SystemColors.Control;
                DraftHandButtons.Add(b);
                __DraftHandContainer.Controls.Add(b);

                // Increment y:
                y += 3 + td.Height;
            }
        }