diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/GuiParameters.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/GuiParameters.java new file mode 100644 index 0000000..0b50caf --- /dev/null +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/GuiParameters.java @@ -0,0 +1,30 @@ +package ch.unibas.dmi.dbis.cs108.multiplayer.helpers; + +/** + * This class contains all parameters for the PTGUI protocol message + */ +public class GuiParameters { + + /** + * Tells GUI to update the gameStateModel, in the form {@code UPDATE$name:role:kickedOff$name:role:kickedOff} ... usw. + */ + public static final String updateGameState = "UPDATE"; + /** + * Tells Gui, that the following statement after $, is a String containing the listOfLobbies + */ + public static final String listOfLobbies = "LOBBIES"; + + /** + * Tells Gui, that what follows is a list of players (per Lobby?) + */ + public static final String listOfPLayers = "PLAYERS"; + + /** + * Tells Gui, that the passenger at position {@code position} has heard some noise + * Form: {@code NOISE$position$} + */ + public static final String noiseHeardAtPosition = "NOISE"; + + + +} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/Protocol.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/Protocol.java index 2fc4bad..2e8b596 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/Protocol.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/helpers/Protocol.java @@ -194,5 +194,12 @@ public class Protocol { */ public static final String changedUserName = "CHNAM"; + /** + * Handles all information that the gui of the client needs. The Form is {@code PTGUI$parameters$msg} + * where the parameter tells the gui to do different things according to {@link GuiParameters} and the message + * contains a certain information i.e. who is where in the train + */ + public static final String printToGUI = "PTGUI"; + }