Commit 132d0f6b authored by Toussaint Etienne's avatar Toussaint Etienne

Controller game Over

parent 9d4f9ffe
......@@ -20,9 +20,9 @@ public class ToServerDeathEvent implements ClientEvent {
@Override
public boolean execute(GameContent gameContent) {
LOGGER.info(entityID+" is dead");
if (AIControler.killOne(entityID);
//if (AIControler.killOne(entityID);
Entity entity = gameContent.getGameState().getEntity(entityID);
gameContent.getGameState().removeEntity(entity);
//gameContent.getGameState().removeEntity(entity);
return false;
}
......
package graphics.graphical_abstraction.panel.menu;
import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.MenuPanel;
import graphics.ingame_input_listener.Input;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by dupriez on 01/01/16.
*/
public interface GameOverPanelAbstraction extends MenuPanelAbstraction {
/*What to do when it have been pressed*/
public void returnButtonAction();
}
package graphics.graphical_abstraction.panel.menu;
/**
* Created by dupriez on 14/11/15.
*/
public class GameOverPanelAbstractionController extends MenuPanelAbstractionController {
private GameOverPanelAbstraction gameOverPanel;
public GameOverPanelAbstractionController(GameOverPanelAbstraction gameOverPanel){
this.menuPanel = gameOverPanel;
this.gameOverPanel = gameOverPanel;
}
public void returnButtonPressed(){
this.gameOverPanel.returnButtonAction();
}
}
package graphics.guiSkeleton.guiPanel.menuPanel;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.graphical_abstraction.panel.menu.GameOverPanelAbstraction;
import graphics.graphical_abstraction.panel.menu.GameOverPanelAbstractionController;
import graphics.graphical_abstraction.panel.menu.MainMenuPanelAbstraction;
import graphics.guiSkeleton.GUIColorsAndFonts;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.guiSkeleton.guiPanel.menuPanel.facilities.ButtonMaker;
......@@ -14,7 +17,9 @@ import java.awt.event.ActionListener;
/**
* Created by dupriez on 01/01/16.
*/
public class GameOverPanel extends MenuPanel {
public class GameOverPanel extends MenuPanel implements GameOverPanelAbstraction {
GameOverPanelAbstractionController controller = new GameOverPanelAbstractionController(this);
public GameOverPanel(GraphicsMaster graphicsMaster) {
super(graphicsMaster);
......@@ -31,7 +36,7 @@ public class GameOverPanel extends MenuPanel {
private ActionListener returnButtonActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
getGraphicsMaster().changeGUIStateTo(GraphicsMaster.GUIStates.MAIN_MENU);
controller.returnButtonPressed();
}
};
......@@ -59,4 +64,9 @@ public class GameOverPanel extends MenuPanel {
public void keyTypedHandler(Input e) {
}
@Override
public void returnButtonAction() {
getGraphicsMaster().changeGUIStateTo(GraphicsMaster.GUIStates.MAIN_MENU);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment