-
Notifications
You must be signed in to change notification settings - Fork 1
/
StateGameOver.java
44 lines (35 loc) · 1.39 KB
/
StateGameOver.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
package org.g70.controller.state;
import org.g70.controller.menu.option.OptionMainMenu;
import org.g70.controller.menu.option.OptionNewGame;
import org.g70.controller.MainController;
import org.g70.controller.menu.MenuController;
import org.g70.model.menu.GameOverModel;
import org.g70.model.drawable.menudrawable.MenuOption;
import org.g70.model.Position;
import org.g70.view.game.GeneralView;
import org.g70.view.game.MenuView;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class StateGameOver extends State {
private GameOverModel mainMenuModel;
private int globalScore;
public StateGameOver(MainController mainController, int globalScore) {
super(mainController);
this.globalScore = globalScore;
initState();
}
@Override
protected void initState() {
List<MenuOption> op = new ArrayList<>();
op.add(new MenuOption("Restart", new Position(2, 15), new OptionNewGame(mainController)));
op.add(new MenuOption("Main Menu", new Position(2, 16), new OptionMainMenu(mainController)));
mainMenuModel = new GameOverModel(op, globalScore);
view = new MenuView(mainController.getGui(), mainMenuModel);
}
@Override
public void run() throws IOException {
MenuController controller = new MenuController(mainController, mainMenuModel, view);
controller.run();
}
}