From 7ffd3cdb1245fee2ffbb78cfd34a5877cee05b42 Mon Sep 17 00:00:00 2001 From: id101010 Date: Fri, 27 May 2016 11:14:13 +0200 Subject: [PATCH] Defined project structure --- src/ch/bfh/sevennotseven/Game.java | 72 +++++++++++++++++++++++++++- src/ch/bfh/sevennotseven/Window.java | 45 +++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/ch/bfh/sevennotseven/Window.java diff --git a/src/ch/bfh/sevennotseven/Game.java b/src/ch/bfh/sevennotseven/Game.java index c2c5217..eaf26dc 100644 --- a/src/ch/bfh/sevennotseven/Game.java +++ b/src/ch/bfh/sevennotseven/Game.java @@ -1,5 +1,75 @@ package ch.bfh.sevennotseven; -public class Game { +import java.awt.Point; +import java.util.List; +public class Game { + + private int[][] field; + + + public Game(){ + this(7); + } + + public Game (int size) { + field = new int[size][size]; + + } + + public boolean isGameOver(){ + return false; + + } + + public int getScore(){ + return 0; + + } + + public int getLevel(){ + return 0; + } + + public List getNextBlocks(){ + return null; + } + + public int[][] getField(){ + return null; + + } + + public boolean canMove(Point src, Point dst){ + return false; + } + + public boolean doMove(Point src, Point dst){ + return false; + } + + public List getPath(Point src, Point dst){ + return null; + } + + public boolean doUndo(){ + return false; + } + + public boolean doFreeMove(Point src, Point dst){ + return false; + } + + public int getAvailFreeMoves(){ + return 0; + } + + public int getAvailUndo(){ + return 0; + } + + public void reset(){ + + } + } diff --git a/src/ch/bfh/sevennotseven/Window.java b/src/ch/bfh/sevennotseven/Window.java new file mode 100644 index 0000000..cefbb14 --- /dev/null +++ b/src/ch/bfh/sevennotseven/Window.java @@ -0,0 +1,45 @@ +/** + * + */ +package ch.bfh.sevennotseven; + +import java.awt.Frame; +import java.awt.GraphicsConfiguration; +import java.awt.HeadlessException; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +/** + * @author aaron + * + */ +public class Window extends Frame { + + private Game game; + + /** + * @param title + * @throws HeadlessException + */ + public Window(String title) throws HeadlessException { + super(title); + this.setVisible(true); + this.addWindowListener(new WindowAdapter(){ + @Override + public void windowClosing(WindowEvent e){ + System.exit(0); + } + }); + + game = new Game(); + } + + /** + * @param args + */ + public static void main(String[] args) { + new Window("Test"); + + } + +}