-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameProperties.java
More file actions
40 lines (31 loc) · 853 Bytes
/
GameProperties.java
File metadata and controls
40 lines (31 loc) · 853 Bytes
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
package Game;
// Parent class (Heirarchical inheritance)
public abstract class GameProperties implements GameFeedback {
private String mode;
private static String gameSelect;
// no args constuctor
GameProperties() {}
GameProperties(String mode) {
this.mode = mode;
}
// Overriding the toString() method
@Override
public String toString() {
return mode;
}
public void setGameSelect(String gameSelect) {
GameProperties.gameSelect = gameSelect;
}
public String getGameSelect() {
return gameSelect;
}
public void win() {
System.out.println("Result: You win!");
}
public void lose() {
System.out.println("Result: You lose!");
}
public void tie() {
System.out.println("Result: It is a tie!");
}
}