From e6a6c22151c5826dd3e54465500e06df34ed3177 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Fri, 22 Mar 2019 06:47:57 +0100 Subject: [PATCH] Added a GameState enum and a Tile class --- src/dev/kske/minesweeper/GameState.java | 12 +++++++ src/dev/kske/minesweeper/Tile.java | 45 +++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/dev/kske/minesweeper/GameState.java create mode 100644 src/dev/kske/minesweeper/Tile.java diff --git a/src/dev/kske/minesweeper/GameState.java b/src/dev/kske/minesweeper/GameState.java new file mode 100644 index 0000000..81d667f --- /dev/null +++ b/src/dev/kske/minesweeper/GameState.java @@ -0,0 +1,12 @@ +package dev.kske.minesweeper; + +/** + * Project: Minesweeper
+ * File: GameState.java
+ * Created: 22.03.2019
+ * Author: Kai S. K. Engelbart + */ +public enum GameState { + + ACTIVE, WON, LOST; +} diff --git a/src/dev/kske/minesweeper/Tile.java b/src/dev/kske/minesweeper/Tile.java new file mode 100644 index 0000000..83292ac --- /dev/null +++ b/src/dev/kske/minesweeper/Tile.java @@ -0,0 +1,45 @@ +package dev.kske.minesweeper; + +/** + * Project: Minesweeper
+ * File: Tile.java
+ * Created: 22.03.2019
+ * Author: Kai S. K. Engelbart + */ +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; } +}