コード例 #1
0
 public BingoCard(int[] numbers)
 {
     Numbers = new BingoCardNumber[numbers.Length];
     for (int index = 0; index < numbers.Length; index++)
     {
         var number = numbers[index];
         Numbers[index] = new BingoCardNumber(number);
     }
 }
コード例 #2
0
        private void drawBingoCard(BingoCard card, Point cardPosition)
        {
            mainLayer.Save();
            mainLayer.Translate(cardPosition.X, cardPosition.Y);

            mainLayer.DrawImage(BingoCard, 0, 0);

            mainLayer.Save();
            mainLayer.Translate(31, 28);
            for (int x = 0; x < BingoGame.BingoCard.NumbersWide; x++)
            {
                for (int y = 0; y < BingoGame.BingoCard.NumbersHigh; y++)
                {
                    var bingoCardNumber = card.GetNumberAt(x, y);

                    var color = BingoCardNumber.ColorToColor(bingoCardNumber.Color);

                    mainLayer.DrawRectangle(color, x * 33, y * 34, 30, 30);
                    mainLayer.DrawImage(_renderer.GetImage("leftBoard.numbers.white." + bingoCardNumber.Number), x * 33 + 1, y * 34 + 8);
                }
            }
            mainLayer.Restore();
            mainLayer.Restore();
        }