Just adding some classes
[puzzles.git] / src / com / github / puzzles / core / Puzzle.java
blob790a723ac8a9ea4483d116d0f00fde0156228eea
1 /**
2 * All puzzles must inherit this class.
3 */
5 package com.github.puzzles.core;
7 public abstract class Puzzle {
8 private int size;
9 private int counter;
10 private Difficulty difficulty;
12 protected Puzzle(int size, int count, Difficulty difficulty){
13 this.size = size;
14 this.counter = count;
15 this.difficulty = difficulty;
18 public abstract boolean check();
20 protected int incrementCounter(){
21 setCounter(++counter);
22 return counter;
25 protected int decrementCounter(){
26 setCounter(--counter);
27 return counter;
30 protected void setCounter(int counter){
31 this.counter = counter;
34 public final int getSize() {
35 return size;
38 public final int getCounter() {
39 return counter;
42 public final Difficulty getDifficulty() {
43 return difficulty;