Esempio n. 1
0
        /// <summary>
        /// Initialize the rack.
        /// </summary>
        public List <RackTile> SetupRack()
        {
            var tiles = new List <RackTile>();

            for (int x = 1; x <= ScrabbleForm.RACK_TILES; x++)
            {
                var tile = new RackTile();
                tile.BackColor = Color.Goldenrod;
                tile.Location  = new Point(175 + (x * (ScrabbleForm.TILE_SIZE + 2)), 825);
                tile.Size      = new Size(ScrabbleForm.TILE_SIZE, ScrabbleForm.TILE_SIZE);
                tile.UseVisualStyleBackColor = false;
                tile.ForeColor = Color.Black;
                tile.Font      = new Font("Verdana", 15.75F, FontStyle.Regular);
                tile.TextAlign = ContentAlignment.MiddleCenter;
                tile.Click    += RackTile_Click;
                tile.Visible   = false;
                ScrabbleForm.Controls.Add(tile);

                tiles.Add(tile);
            }

            FillRack(tiles);

            return(tiles);
        }
Esempio n. 2
0
 public void FillRack(int amount)
 {
     for (var i = 0; i < amount; i++)
     {
         var tile = new RackTile(Player, _ioc);
         Tiles.Add(tile);
     }
 }
Esempio n. 3
0
 public void AddTile(RackTile rack) => Rack.Tiles.Add(rack);