Constructor Summary
Public Constructor | ||
public |
Constructor creates a tile that stores whether the tile is a mine or not, the number of mines adjacent to it, and whether the tile has been flagged or not. |
Member Summary
Public Members | ||
public |
Number of mines adjacent to the tile. |
|
public |
Flag status of the tile. |
|
public |
A mine or not a mine. |
|
public |
Revealed status of the tile. |
Method Summary
Public Methods | ||
public |
flag() Reverses the flag status of the tile. |
|
public |
Gets the number of mines adjacent to the tile. |
|
public |
Gets whether the tile has been flagged or not. |
|
public |
Gets whether the tile is a mine or not. |
|
public |
Gets whether the tile has been revealed or not. |
|
public |
reveal() Reveals the tile, setting revealed to true. |
|
public |
setAdjacent(adj: number) Sets the number of mines adjacent to the tile. |
|
public |
setMine() Sets the tile's status to be a mine. POSTCONDITION: isMine is true. |
Public Constructors
public constructor() source
Constructor creates a tile that stores whether the tile is a mine or not, the number of mines adjacent to it, and whether the tile has been flagged or not. POSTCONDITION: isMine, adjNum, flagged, and revealed, all now have set values.
Public Members
Public Methods
public flag() source
Reverses the flag status of the tile. If it has been flagged, set to false. If it has not, set to true. POSTCONDTION: flagged is inverted