refactor: changed tuple test variable name to t for readability

This commit is contained in:
Yannik Bretschneider 2021-04-30 23:47:41 +02:00
parent e062de635d
commit 01ee534a56
2 changed files with 42 additions and 3 deletions

View File

@ -0,0 +1,39 @@
package uulm.teamname.marvelous.gamelibrary.json.basic;
import uulm.teamname.marvelous.gamelibrary.json.MessageType;
/**
* The basic message from the standard, containing all possible expansion keys.
* In other words, one needs to check the messageType, as fields that aren't sent
* are null. Note that ingame messages are not deserialized into the {@link BasicMessage}, but instead
* into the {@link uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure}.
*/
public class BasicMessage {
/**
* The user ID is (apparently) a MD5 hash made from the username and device IP. It is assigned by the server.
*/
String userID;
/**
* The messageType describes the type of message that might be sent
*/
MessageType messageType;
/**
* I have no idea what this might be used for, even less the boolean in the answer
*/
String optionals;
/**
* <b>Exists only in a HelloClient message.</b>
* Describes whether the user was in a running game before reconnecting.
*/
boolean runningGame;
/**
* <b>Exists only in GameAssignment and GeneralAssignment messages.</b>
* Used for notifying the player of which party they have been assigned to
*/
String gameID;
}

View File

@ -7,8 +7,8 @@ import static org.junit.jupiter.api.Assertions.*;
class TupleTest {
@Test
void basicTest() {
Tuple<Integer, Integer> a = new Tuple<>(0, 1);
assertEquals((int) a.item1, 0);
assertEquals((int) a.item2, 1);
Tuple<Integer, Integer> t = new Tuple<>(0, 1);
assertEquals((int) t.item1, 0);
assertEquals((int) t.item2, 1);
}
}