Commit 5d97202b authored by Bogdan's avatar Bogdan

Improved GameStarter.

parent 412bcdd3
...@@ -3,6 +3,8 @@ package gameloop; ...@@ -3,6 +3,8 @@ package gameloop;
import artificial_intelligence.AIControler; import artificial_intelligence.AIControler;
import core.relayer.Relayer; import core.relayer.Relayer;
import core.relayer.Relayers; import core.relayer.Relayers;
import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.guiSkeleton.GraphicsMaster;
import logging.Logging; import logging.Logging;
import network.inner_shell.ClientConnection; import network.inner_shell.ClientConnection;
import network.inner_shell.LocalConnection; import network.inner_shell.LocalConnection;
...@@ -13,9 +15,11 @@ import network.inner_shell.NetworkConnection; ...@@ -13,9 +15,11 @@ import network.inner_shell.NetworkConnection;
* Some changes made by Guerquin on 17/12/15 * Some changes made by Guerquin on 17/12/15
* *
* This class's purpose is to start the gameLoop with the initialized network connection. * This class's purpose is to start the gameLoop with the initialized network connection.
* and then to stop the game if a connection problem appears
* *
* @author Dupriez Thomas * @author Dupriez Thomas
* @author Guerquin Arnaud * @author Guerquin Arnaud
* @author bogdanbear
* *
*/ */
public class GameStarter { public class GameStarter {
...@@ -63,6 +67,11 @@ public class GameStarter { ...@@ -63,6 +67,11 @@ public class GameStarter {
DummyLocalGameLoop.getInstance().getNetworkConnection().initiateConnectionEnd(); DummyLocalGameLoop.getInstance().getNetworkConnection().initiateConnectionEnd();
DummyLocalGameLoop.getInstance().pauseGame(); DummyLocalGameLoop.getInstance().pauseGame();
} }
static public void initiateBrokenConnectionMeasures()
{
leaveGame();
GraphicsMaster.getInstance().changeGUIStateTo(GraphicsMasterAbstraction.GUIStates.LOST_CONNECTION);
}
/** /**
* To be called by the gui when the player wants to launch a game * To be called by the gui when the player wants to launch a game
......
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