Example #1
0
        public void RenderLocationButtons(Queue <Entity> locations, Gamedata.Gamedata gamedata)
        {
            this.SuspendLayout();

            tableLayoutPanelMain.RowCount = locations.Count;
            tableLayoutPanelMain.RowStyles.Clear();
            tableLayoutPanelMain.Controls.Clear();

            locationButtons = new LocationButton[locations.Count];
            int i = 0;

            foreach (Entity entity in locations)
            {
                LocationButton lb = new LocationButton(gamedata.GetValue <String>(entity.ID, "Caption", entity.ID));
                tableLayoutPanelMain.Controls.Add(lb, 0, i);
                locationButtons[i] = lb;
                i++;

                lb.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);

                this.tableLayoutPanelMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
            }

            this.ResumeLayout();
        }
Example #2
0
        public Gamemanager(FormMain formMain)
        {
            this.formMain = formMain;

            gamedata = new Gamedata.Gamedata();
        }