Example #1
0
 /// <summary>
 /// Resets opponents values to start new game.
 /// </summary>
 public void Reset()
 {
     lock (this)
     {
         for (int x = 0; x < 12; x++)
         {
             for (int y = 0; y < 22; y++)
             {
                 _grid[x, y] = Space.Empty;
             }
         }
         _stats.Reset();
         _gameOver = false;
     }
 }
Example #2
0
 /// <summary>
 /// Resets the game.
 /// </summary>
 public void Reset(bool spawnBrick = true)
 {
     lock (this)
     {
         ClearGrid(_grid);
         for (int x = 0; x < 12; x++)
         {
             _grid[x, 0]      = Space.Edge;
             _grid[x, 22 - 1] = Space.Edge;
         }
         for (int y = 0; y < 22; y++)
         {
             _grid[0, y]      = Space.Edge;
             _grid[12 - 1, y] = Space.Edge;
         }
         _brick = null;
         _hold  = null;
         _stats.Reset();
         if (spawnBrick)
         {
             SpawnBrick();
         }
     }
 }