Added a GameState enum and a Tile class
This commit is contained in:
parent
2bbaec0939
commit
d21a162dcb
12
src/dev/kske/minesweeper/GameState.java
Normal file
12
src/dev/kske/minesweeper/GameState.java
Normal 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;
|
||||||
|
}
|
45
src/dev/kske/minesweeper/Tile.java
Normal file
45
src/dev/kske/minesweeper/Tile.java
Normal 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; }
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user