Added a PTGUI protocol message and class with all parameters for that message, to link gui to server
This commit is contained in:
parent
384f2071d2
commit
dd757b22f0
@ -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";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -194,5 +194,12 @@ public class Protocol {
|
|||||||
*/
|
*/
|
||||||
public static final String changedUserName = "CHNAM";
|
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";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user