forked from dntf0llow/openHalma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_test.java
81 lines (70 loc) · 2.73 KB
/
_test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import java.util.LinkedList;
import java.awt.Color;
public class _test
{
StarBoard sb;
String savedBoard;
LinkedList<Player> plist = new LinkedList<>();
Game game;
public static void main(String[] args) {
new _test();
}
public _test() {
main();
}
public void main(){
//makeTest();
//plist.add(new LocalPlayer(FIELD_VALUE.PLAYER2, Color.red));
//plist.add(new ComputerPlayer(FIELD_VALUE.PLAYER1, Color.blue, "", AI.STRATEGY.FARTHEST, 1));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER1, Color.blue, "Human"));
plist.add(new ComputerPlayer(FIELD_VALUE.PLAYER2, Color.red, "", AI.STRATEGY.FARTHEST, 6));
/*plist.add(new LocalPlayer(FIELD_VALUE.PLAYER3, Color.yellow));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER3, Color.green));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER4, Color.orange));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER5, Color.magenta));
//plist.add(new LocalPlayer(FIELD_VALUE.PLAYER6, Color.yellow));*/
guiTest();
}
public void makeTest()
{
Interface i = new Text();
LinkedList<Player> plist = new LinkedList<>();
//plist.add(new LocalPlayer(FIELD_VALUE.PLAYER1, Color.blue, ));
/*plist.add(new LocalPlayer(FIELD_VALUE.PLAYER2, null));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER3, null));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER4, null));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER5, null));
plist.add(new LocalPlayer(FIELD_VALUE.PLAYER6, null));*/
sb = BoardFactory.createStandardStarBoard(13,plist,0);
System.out.println(sb.toString());
LinkedList<Position> posis;
savedBoard = sb.writeToString();
StarBoard board2 = new StarBoard();
//System.out.println(savedBoard);
board2.readFromString(savedBoard);
if (board2.equals(sb)) System.out.println("yay");
}
public void guiTest() {
/*StarBoard boards[] = new StarBoard[5];
Graphical interfaces[] = new Graphical[5];
Game games[] = new Game[5];
int x=5;
for(int i=0;i<4;i++) {
boards[i] = BoardFactory.createStandardStarBoard(x+4*i,plist,0);
interfaces[i] = new Graphical();
games[i] = new Game(interfaces[i],boards[i]);
games[i].addPlayer(plist.get(0));
games[i].addPlayer(plist.get(1));
games[i].addPlayer(plist.get(2));
interfaces[i].repaint();
}*/
//*
MainMenu mainMenu = new MainMenu();
if (true) return;
//*/
sb = BoardFactory.createStandardStarBoard(5, plist, 0);
if (sb==null) System.exit(55);
game = new Game(sb, plist);
game.start();
}
}