-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutline for Mastermind.txt
66 lines (41 loc) · 1.37 KB
/
Outline for Mastermind.txt
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
// Mastermind
class Board { // Model Class
private int[] correctPattern;
private Guess[] guesses;
public Board();
public void setCorrectPattern(int[] pattern);
public int[] getCorrectPattern();
public void checkGuess(int[] guessPattern); // set Independent
public Guess[] getGuesses(); // get dependent
}
class Guess {
int[] pattern;
int[] feedback;
public Guess(int[] newPattern, int[] newFeedback);
public void setPattern(int[] newPattern);
public int[] getPattern();
public void setFeedback(int[] newFeedback);
public int[] getFeedback();
}
class Player extends EventHandler<ActionEvent> { // Controller Class
private int buttonToModify;
public void handle(Action event, Main main, Board board); // Read states of buttons
public void handle(String input, Main main, Board board); // for text-only version
public void setColor(Button button, Color color);
}
class Main { // View Class
private Player player;
private Board board;
private button checkButton;
private button deleteButton;
private button newGameButton;
private button blue, green, orange, red, purple, yellow; // The color controls
private button guess1, guess2, guess3, guess4; // The guessing buttons
public static void main(String[] args);
public void start(Stage primaryStage);
// ...
// getters for buttons
// ...
public void reset();
public void update();
}