Ejemplo n.º 1
0
 /// <summary>
 /// Field consturctor method that gets a given field size parameter and generates the appropriate field.
 /// </summary>
 /// <param name="currentFieldSize">A valid size value for the game field size.</param>
 public Field(int currentFieldSize)
 {
     this.FieldPositions = new Cell[currentFieldSize, currentFieldSize];
     this.DetonatedMines = 0;
     this.currentCellFactory = CellFactory.Instance();
     this.currentMineFactory = MineFactory.Instance();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Method that creates and returns a MineFactory instance if none is present.
 /// </summary>
 /// <returns>The current MineFactory instance.</returns>
 public static MineFactory Instance()
 {
     if (instance == null)
     {
         instance = new MineFactory();
     }
     return instance;
 }