public HarvestEntryControl(Model.HarvestEntry he)
 {
     InitializeComponent();
     HE = he;
     ItemNameBox.Text = HE.Item.Name;
     DC.Text          = HE.DC.ToString();
     for (int i = 0; i < HE.ResultRolls.Count; i++)
     {
         if (i != 0)
         {
             RollResultTable.RowCount += 1;
         }
         Label l = new Label()
         {
             Text = HE.ResultRolls.ToList()[i].Key, Parent = RollResultTable
         };
         RollResultTable.SetRow(l, i);
         RollResultTable.SetColumn(l, 0);
         Button btn = new Button()
         {
             Text = "Roll", Parent = RollResultTable
         };
         btn.Click += new EventHandler((x, y) => MessageBox.Show("Roll result: " + HE.ResultRolls.ToList()[RollResultTable.GetRow((Control)x)].Value.roll().ToString()));
         RollResultTable.SetRow(btn, i);
         RollResultTable.SetColumn(btn, 1);
     }
 }
Beispiel #2
0
 public HarvestEntryControl generate(Model.HarvestEntry he) => new HarvestEntryControl(he);