Added a GameState enum and a Tile class

This commit is contained in:
Kai S. K. Engelbart 2019-03-22 06:47:57 +01:00
parent 0ab43c1d75
commit e6a6c22151
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package dev.kske.minesweeper;
/**
* Project: <strong>Minesweeper</strong><br>
* File: <strong>GameState.java</strong><br>
* Created: <strong>22.03.2019</strong><br>
* Author: <strong>Kai S. K. Engelbart</strong>
*/
public enum GameState {
ACTIVE, WON, LOST;
}

View File

@ -0,0 +1,45 @@
package dev.kske.minesweeper;
/**
* Project: <strong>Minesweeper</strong><br>
* File: <strong>Tile.java</strong><br>
* Created: <strong>22.03.2019</strong><br>
* Author: <strong>Kai S. K. Engelbart</strong>
*/
public class Tile {
private boolean mine, flagged, touched;
private boolean drawSurroundingMines;
private int surroundingMines;
public Tile() {
mine = false;
flagged = false;
touched = false;
drawSurroundingMines = false;
surroundingMines = 0;
}
public boolean isMine() { return mine; }
public void setMine(boolean mine) { this.mine = mine; }
public boolean isFlagged() { return flagged; }
public void setFlagged(boolean flagged) { this.flagged = flagged; }
public boolean isTouched() { return touched; }
public void setTouched(boolean touched) { this.touched = touched; }
public boolean isDrawSurroundingMines() { return drawSurroundingMines; }
public void setDrawSurroundingMines(boolean drawSurroundingMines) {
this.drawSurroundingMines = drawSurroundingMines;
}
public int getSurroundingMines() { return surroundingMines; }
public void setSurroundingMines(int surroundingMines) { this.surroundingMines = surroundingMines; }
}