|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGameEngine.Core.Message
public class Message
responsible for create general messages that are used in all modes. the messages that are specific to mode will be created in GameMode class or child class
Field Summary | |
---|---|
static java.lang.String |
HANDSHAKE_MASTER
Handshake string. |
static java.lang.String |
HANDSHAKE_MOBILE
|
static int |
MAX_NUMBER_OF_FIELDS_IN_MSG
|
static char |
MSG_ANSWER
|
static char |
MSG_END_OF_GAME
|
static char |
MSG_END_OF_ROUND
|
static char |
MSG_EXIT
|
static char |
MSG_GAME_MODE
|
static char |
MSG_LECTURE_ID
|
static char |
MSG_LOGIN
|
static char |
MSG_MOBILE_LOGIN
|
static char |
MSG_NEXT_QUESTION
|
static char |
MSG_NUMBER_OF_QUES
|
static char |
MSG_QUESTION
|
static char |
MSG_START
|
static char |
MSG_UNKNOWN_MESSAGE
These characters are prepended to messages that are sent to Game Engine, to show what type of messages they are |
protected java.lang.String |
msgContent
|
protected java.lang.String |
msgRaw
|
protected char |
msgType
|
Constructor Summary | |
---|---|
Message(java.lang.String rawMessage)
|
Method Summary | |
---|---|
static java.lang.String |
createEndGame4Mobile(GameEngine.Core.MobileCommunicator c)
|
static java.lang.String |
createEndGameMessage()
|
static java.lang.String |
createExitMessage()
|
static java.lang.String |
createLoginOk()
|
static java.lang.String |
createMobileLoginMsg(java.lang.String user)
|
static java.lang.String |
createStartGameMessage()
|
int |
getAnswerIndex()
|
java.lang.String |
getMsgContent()
|
java.lang.String |
getRawMessage()
|
char |
getTypeOfMsg()
|
boolean |
isAnswer()
check if the message received is an answer from mobile |
java.lang.String |
makeClientQuestion(GameEngine.Core.Question q)
Creates the question to be sendt to the StudentClient. |
java.lang.String |
makeMasterQuestion(GameEngine.Core.Question q)
Creates the question to be sendt to the MasterClient. |
private java.lang.String |
makeQuestionRoot(GameEngine.Core.Question q)
Creates the root of the question to be sendt to eighter the studenclients or the masterclient. |
void |
printMsg()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected char msgType
protected java.lang.String msgContent
protected java.lang.String msgRaw
public static final int MAX_NUMBER_OF_FIELDS_IN_MSG
public static final char MSG_UNKNOWN_MESSAGE
public static final char MSG_NUMBER_OF_QUES
public static final char MSG_GAME_MODE
public static final char MSG_START
public static final char MSG_EXIT
public static final char MSG_LECTURE_ID
public static final char MSG_END_OF_GAME
public static final char MSG_END_OF_ROUND
public static final char MSG_QUESTION
public static final char MSG_ANSWER
public static final char MSG_LOGIN
public static final char MSG_MOBILE_LOGIN
public static final char MSG_NEXT_QUESTION
public static final java.lang.String HANDSHAKE_MASTER
public static final java.lang.String HANDSHAKE_MOBILE
Constructor Detail |
---|
public Message(java.lang.String rawMessage)
Method Detail |
---|
public char getTypeOfMsg()
public java.lang.String getMsgContent()
public java.lang.String getRawMessage()
private java.lang.String makeQuestionRoot(GameEngine.Core.Question q)
public java.lang.String makeClientQuestion(GameEngine.Core.Question q)
questionState
- the state of the question
public java.lang.String makeMasterQuestion(GameEngine.Core.Question q)
questionState
- the state of the question
public static java.lang.String createExitMessage()
public static java.lang.String createEndGameMessage()
public static java.lang.String createStartGameMessage()
public static java.lang.String createLoginOk()
public static java.lang.String createEndGame4Mobile(GameEngine.Core.MobileCommunicator c)
public void printMsg()
public boolean isAnswer()
public int getAnswerIndex()
public static java.lang.String createMobileLoginMsg(java.lang.String user)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |