Commit ac154d31 authored by Theodore Lopez's avatar Theodore Lopez

Stairs now end the game

parent 2348118f
package gameloop;
import core.event.Event;
import core.event.MapChangeEvent;
import core.event.MapInit;
import core.event.ToClientDeathEvent;
import core.gamestate.GameContent;
......@@ -149,6 +150,9 @@ public class DummyLocalGameLoop extends Thread{
setFollowedRelayer(firstEntityRelayer);
relayerSemaphore.release();
}
if(eventToReceive instanceof MapChangeEvent){
GraphicsMasterAbstraction.getInstance().changeGUIStateTo(GraphicsMasterAbstraction.GUIStates.GAME_WIN);
}
if (eventToReceive instanceof ToClientDeathEvent && ((ToClientDeathEvent) eventToReceive).getEntityID()==followedRelayer.getCharacter().getID()) {
GraphicsMasterAbstraction.getInstance().changeGUIStateTo(GraphicsMasterAbstraction.GUIStates.GAME_OVER);
......
......@@ -39,7 +39,8 @@ public abstract class GraphicsMasterAbstraction {
LOST_CONNECTION,
PLEASE_WAIT,
SERVER_ADDRESS_PANEL,
SERVER_CREATED_PANEL
SERVER_CREATED_PANEL,
GAME_WIN;
}
//This map indicates to graphicsMaster which guiPanel is associated to each GUIState, it is filled in Graphicsmaster's constructor
protected HashMap<GUIStates, PanelAbstraction> mapGUIStatesToGUIPanel = new HashMap<>();
......
......@@ -58,6 +58,7 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
mapGUIStatesToGUIPanel.put(GUIStates.SERVER_ADDRESS_PANEL, new ServerAddressPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_OVER, new GameOverPanel(this));
mapGUIStatesToGUIPanel.put(GUIStates.GAME_WIN, new GameWinPanel(this));
}
public static void build() {
......
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