package de.htwg.gobang.ui;

import java.util.InputMismatchException;
import java.util.Scanner;

import de.htwg.gobang.controller.GbLogic;
import de.htwg.gobang.entities.GameToken;
import de.htwg.gobang.entities.TokenO;
import de.htwg.gobang.entities.TokenX;

public class TUI {
	
	GameToken player1;
	GameToken player2;
	GbLogic myGame;
	
	private static final Scanner scan = new Scanner(System.in); 
	static int choice;
	
	public static void main(String[] args) {
			welcome();
			
			while(true){
				try {
					switch(choice = scan.nextInt()) {
					case 1:
						game();
						break;
					case 2:
						help();
						welcome();
						break;
					case 3:
						System.exit(0);
						break;
					default:
						System.out.println("Please choose 1, 2 or 3");
						welcome();
						break;
					} 
					
				} catch (InputMismatchException x) {
					System.err.println("Wrong input type. Please choose 1, 2 or 3");
					welcome();
					break;
					}
			}
	}
			
	private static void game() {
		field();
		
	}

	private static void help() {
		System.out.println("Go Bang is a strategy board game for two players from Japane. "
				+ "\nIt is played on a board of 19 x 19 fields. The players aim to align five "
				+ "\nstones of the same token suite in vertical, horizontal or diagonal lines. ");
		System.out.println();
	}

	private static void welcome() {
		System.out.println("Welcome to GoBang");
		System.out.println("1: start new game");
		System.out.println("2: help");
		System.out.println("3: quit");
		
	}

	private static void field() {
		
	}

	private void newGame(){
		player1 = new TokenX();
		player2 = new TokenO();
		myGame = new GbLogic(player1, player2);
	}

}

@@ -274,16 +274,31 @@
 UI %7B%0A%09%0A%09
+private static 
 GameToke
@@ -309,16 +309,31 @@
 ayer1;%0A%09
+private static 
 GameToke
@@ -344,16 +344,31 @@
 ayer2;%0A%09
+private static 
 GbLogic 
@@ -407,17 +407,17 @@
 Scanner 
-s
+S
 can = ne
@@ -440,16 +440,24 @@
 .in); %0A%09
+private 
 static i
@@ -467,16 +467,47 @@
 choice;%0A
+%09private static String%5B%5D line;%0A
 %09%0A%09publi
@@ -607,17 +607,17 @@
 hoice = 
-s
+S
 can.next
@@ -1069,16 +1069,29 @@
 ame() %7B%0A
+%09%09newGame();%0A
 %09%09field(
@@ -1654,16 +1654,23 @@
 private 
+static 
 void new

put some variables in Tui to static