-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathPegSolitaireGame.java
109 lines (94 loc) · 3.12 KB
/
PegSolitaireGame.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
public interface PegSolitaireGame{
/**
* Method to create first board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board1(boolean is_loaded);
/**
* Method to create second board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board2(boolean is_loaded);
/**
* Method to create third board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board3(boolean is_loaded);
/**
* Method to create fourth board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board4(boolean is_loaded);
/**
* Method to create fifth board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board5(boolean is_loaded);
/**
* Method to create sixth board from scratch.
* @param is_loaded True if the board is loaded from a file.
*/
void Board6(boolean is_loaded);
/**
* Method to add cell buttons to the frame for first 5 types.
*/
void addBoard();
/**
* Method to add cell buttons to the frame for last type.
*/
void addBoardTriangle();
/**
* Method to add listeners for the cell buttons.
*/
void addingListenersType();
/**
* Method to determine if move is valid for the up.
* @param yRow Row value of the selected cell.
* @param yCol Column value of the selected cell.
* @param row Row value of the slot that user wants to go.
* @param col Column value of the slot that user wants to go.
* @return boolean to specify if the move is valid.
*/
boolean is_valid_up(int yRow, int yCol, int row, int col);
/**
* Method to determine if move is valid for the down.
* @param yRow Row value of the selected cell.
* @param yCol Column value of the selected cell.
* @param row Row value of the slot that user wants to go.
* @param col Column value of the slot that user wants to go.
* @return boolean to specify if the move is valid.
*/
boolean is_valid_down(int yRow, int yCol, int row, int col);
/**
* Method to determine if move is valid for the right.
* @param yRow Row value of the selected cell.
* @param yCol Column value of the selected cell.
* @param row Row value of the slot that user wants to go.
* @param col Column value of the slot that user wants to go.
* @return boolean to specify if the move is valid.
*/
boolean is_valid_right(int yRow, int yCol, int row, int col);
/**
* Method to determine if move is valid for the left.
* @param yRow Row value of the selected cell.
* @param yCol Column value of the selected cell.
* @param row Row value of the slot that user wants to go.
* @param col Column value of the slot that user wants to go.
* @return boolean to specify if the move is valid.
*/
boolean is_valid_left(int yRow, int yCol, int row, int col);
/**
* Method to determine if the game is finished.
* @return boolean to specify if the game is finished.
*/
boolean is_finished();
/**
* Method to refresh the current screen.
*/
void reset_screen();
/**
* Method to make the computer play 1 move.
* @return boolean to specify if the game is finished.
*/
boolean autoOne();
}