-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNintendoState.java
40 lines (35 loc) · 948 Bytes
/
NintendoState.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
//Written by Nicholas Garofalo
public class NintendoState implements State {
private GameConsole gameConsole;
private String[] games = new String[5];
@Override
public void pressHomeButton() {
System.out.println("Displaying Home Screen...");
}
@Override
public void pressNintendoButton() {
System.out.println("You are already viewing Nintendo.");
}
@Override
public void pressXBoxButton() {
System.out.println("Starting XBox...");
}
@Override
public void pressGameButton() {
System.out.println("You have the following games:");
for(int i = 0; i < games.length; i++) {
if(i == 0)
games[i] = "Mario Kart";
else if(i == 1)
games[i] = "Super Mario Bros.";
else if(i == 2)
games[i] = "Super Smash Bros.";
else if(i == 3)
games[i] = "Pokemon";
else if(i == 4)
games[i] = "Zelda";
System.out.println(games[i]);
}
System.out.println("\n");
}
}