feat: created POJOs for message structures from the standard document

This commit is contained in:
Yannik Bretschneider
2021-04-29 21:41:31 +02:00
parent 6cce28ef62
commit 71f571fee1
20 changed files with 505 additions and 8 deletions

View File

@ -1,6 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.events;
import uulm.teamname.marvelous.gamelibrary.json.MessageStructure;
import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
/** Represents an abstract event sent inside a {@link MessageStructure} between client and server.
*/

View File

@ -1,4 +0,0 @@
package uulm.teamname.marvelous.gamelibrary.json;
public class CharacterConfiguration {
}

View File

@ -1,6 +1,7 @@
package uulm.teamname.marvelous.gamelibrary.json;
import jdk.jshell.spi.ExecutionControl;
import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
/** Contains JSON encoding and decoding.
*/

View File

@ -0,0 +1,20 @@
package uulm.teamname.marvelous.gamelibrary.json;
/**
* Enum describing all possible MessageTypes as defined by Standard document
*/
public enum MessageType {
HELLO_CLIENT,
HELLO_SERVER,
RECONNECT,
PLAYER_READY,
GAME_ASSIGNMENT,
GENERAL_ASSIGNMENT,
CHARACTER_SELECTION,
CONFIRM_SELECTION,
GAME_STRUCTURE,
REQUESTS,
EVENTS,
GOODBYE_CLIENT,
ERROR
}

View File

@ -0,0 +1,9 @@
package uulm.teamname.marvelous.gamelibrary.json.config;
/**
* Enum defining the different field types as described by standard document
*/
public enum FieldType {
GRASS,
ROCK,
}

View File

@ -0,0 +1,42 @@
package uulm.teamname.marvelous.gamelibrary.json.config;
/**
* POJO describing the PartyConfiguration as defined by the standard document
*/
public class PartyConfiguration {
/** Max round amount in a match */
public int maxRounds;
/** Max round time in a match in seconds */
public int maxRoundTime;
/** Max overall time in a match in seconds */
public int maxGameTime;
/** Max time a single animation might take up in seconds */
public int maxAnimationTime;
/** Cooldown of the space stone in rounds */
public int spaceStoneCD;
/** Cooldown of the mind stone in rounds */
public int mindStoneCD;
/** Cooldown of the reality stone in rounds */
public int realityStoneCD;
/** Cooldown of the power stone in rounds */
public int powerStoneCD;
/** Cooldown of the time stone in rounds */
public int timeStoneCD;
/** Cooldown of the soul stone in rounds */
public int soulStoneCD;
/** Damage the mind stone does when used */
public int mindStoneDMG;
/** Max pause time. Optional */
public int maxPauseTime;
}

View File

@ -0,0 +1,14 @@
package uulm.teamname.marvelous.gamelibrary.json.config;
import uulm.teamname.marvelous.gamelibrary.json.config.FieldType;
/**
* POJO describing the ScenarioConfig as defined by the standard document
*/
public class ScenarioConfig {
/** An array containing the map based on the {@link FieldType} enum. So, ROCK and GRASS basically. */
public FieldType[][] scenario;
public String author;
public String name;
}

View File

@ -1,4 +1,4 @@
package uulm.teamname.marvelous.gamelibrary.json;
package uulm.teamname.marvelous.gamelibrary.json.ingame;
import uulm.teamname.marvelous.gamelibrary.events.Event;

View File

@ -1,6 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.requests;
import uulm.teamname.marvelous.gamelibrary.json.MessageStructure;
import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
/** Represents an abstract request sent inside a {@link MessageStructure} between client and server.
*/