public GameManager(GameScreenWithControls window) { // fill available numbers which will be used to pick numbers for (int i = 0; i < 100; i++) { availableNums.Add(i); } cards.Add(new BingoCard(window)); Console.WriteLine(cards[0]); }
public BingoCard(GameScreenWithControls window) { this.window = window; // get mulitdimensional array numbers = GenerateCardNumbers(); // create labels for UI int x; int y = 50; int loopCount = 1; // loop through rows for (int i = 0; i < numbers.GetLength(0); i++) { x = 30; y += 80; // loop through columns for (int j = 0; j < numbers.GetLength(1); j++) { // create new label for every number Label label = new Label(); label.BackColor = Color.White; label.Font = new Font("Microsoft Sans Serif", 23F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))); label.ForeColor = Color.DarkRed; label.Location = new Point(x, y); label.Name = "box" + loopCount; label.Padding = new Padding(10); label.Size = new Size(75, 75); // dynamic tabindex and text label.TabIndex = loopCount; label.Text = numbers[i, j].ToString(); label.TextAlign = ContentAlignment.MiddleCenter; window.Controls.Add(label); x += 80; loopCount++; } } Console.WriteLine("Bingo card created"); }