示例#1
0
 public Cell(int row, int col, bool isMine)
 {
     MinesAround = 0;
     _row        = row;
     _col        = col;
     Visibility  = CellVisibility.Hidden;
     IsMine      = isMine;
 }
示例#2
0
文件: Cell.cs 项目: klacs/Minesweeper
 public Cell(int row, int col, bool isMine)
 {
     MinesAround = 0;
     _row = row;
     _col = col;
     Visibility = CellVisibility.Hidden;
     IsMine = isMine;
 }
示例#3
0
文件: Cell.cs 项目: klacs/Minesweeper
 public void Reveal(Board board)
 {
     if (!IsMine)
     {
         BrowseAllCells(board, CountMinesAround);
         BrowseAllCells(board, Reveal);
     }
     Visibility = CellVisibility.Revealed;
 }
示例#4
0
文件: Cell.cs 项目: klacs/Minesweeper
 public void Reveal2(Board board)
 {
     CellAction2 += CountMinesAround;
     CellAction2 += Reveal;
     
     if (!IsMine)
     {
         BrowseAllCells2(board);
     }
     Visibility = CellVisibility.Revealed;
 }
示例#5
0
 /// <summary>
 /// Create instance of dungeon with given size
 /// </summary>
 /// <param name="Width">Width of the dungeon</param>
 /// <param name="Height">Height of the dungeon</param>
 /// <param name="Generator">
 /// Generator to use to build the dungeon.
 /// Defaults to DefaultGenerator
 /// </param>
 public Dungeon(int Width, int Height)
 {
     TileMap       = new DungeonCell[Width, Height];
     VisibilityMap = new CellVisibility[Width, Height];
 }