From 71f571fee152a20424f4d74217922a2318d08397 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 29 Apr 2021 21:41:31 +0200 Subject: [PATCH] feat: created POJOs for message structures from the standard document --- .../7.0/executionHistory/executionHistory.bin | Bin 19528 -> 20800 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.0/fileHashes/fileHashes.bin | Bin 18697 -> 18847 bytes .gradle/7.0/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/outputFiles.bin | Bin 18749 -> 18803 bytes .idea/.gitignore | 2 + .idea/misc.xml | 2 +- .idea/uiDesigner.xml | 124 ++++++++++++ .../marvelous/gamelibrary/events/Event.java | 2 +- .../json/CharacterConfiguration.java | 4 - .../marvelous/gamelibrary/json/JSON.java | 1 + .../gamelibrary/json/MessageType.java | 20 ++ .../gamelibrary/json/config/FieldType.java | 9 + .../json/config/PartyConfiguration.java | 42 ++++ .../json/config/ScenarioConfig.java | 14 ++ .../json/{ => ingame}/MessageStructure.java | 2 +- .../gamelibrary/requests/Request.java | 2 +- team25.iml | 185 ++++++++++++++++++ team25.ipr | 104 ++++++++++ 20 files changed, 505 insertions(+), 8 deletions(-) create mode 100644 .idea/uiDesigner.xml delete mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/CharacterConfiguration.java create mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageType.java create mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/FieldType.java create mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/PartyConfiguration.java create mode 100644 src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/ScenarioConfig.java rename src/main/java/uulm/teamname/marvelous/gamelibrary/json/{ => ingame}/MessageStructure.java (92%) create mode 100644 team25.iml create mode 100644 team25.ipr diff --git a/.gradle/7.0/executionHistory/executionHistory.bin b/.gradle/7.0/executionHistory/executionHistory.bin index eb0209945a9e8965a200a8277b7968920449ca3e..d99eea51634c50bbca46eddb0983602abc4de7e8 100644 GIT binary patch delta 1108 zcmX>xgYm#3#tkMC^{n46{aE4=w|PAS82EVnhk=EUGpE`%`9Q>dJ7B^xt@gs(Ui(%- z#QmjV;s(jm5lp|NlUV&W(yc#5WpD5Z~Pu1+bB#>(GIMhn1ooJ%O?P#2ohtR+ zc!QR7%JkjmT7OQ|Kjg{62=t!~$g^EQ+yue|JCCP?VpQnp^_%Zaovj zeth~e^GZ^S@)C3OK%o?zoS2j7oS&DLnO<6yTBKqKf&zlpE6itdrA<5~Zu<9da~Ts+ z4uQFY1?CWvL$IKTL11U}J+`Bv+~I2fRt8LK&C9tA4#B;0;1KKwg`h1En}RSgA-D%$ zNI;VdAK2yL`9;~q1&PVvBxAzJK#WdIjl}vn7M5ztix~uT{&{Q4JNmwxufo^GogFFh z1nlQUUSK~v0sYKy4T#Ty@NA>f)XJQsV)M+hjKs3k{IdMK?262kT;qydNEV3;W;nn& zIp0%MAtf_0JuknwBr~~K&n2}WH7_MKFS#-(wIIK!BqXso8Av4?t E0B2g8RR910 delta 44 vcmX@Gi1EY>#tkMCjEs|OB_w$MLjeN=gXTuXAL1JgUW!jNVBhTM!Oj8z#N87C diff --git a/.gradle/7.0/executionHistory/executionHistory.lock b/.gradle/7.0/executionHistory/executionHistory.lock index a5dfef8e77ddf3a1af3373423ae8c4164c507486..3d0543e1688ea6cdbd143e398702d7874e62ed04 100644 GIT binary patch literal 17 UcmZR!jET;=9P;H50|W>H05N|AOaK4? literal 17 UcmZR!jET;=9P;H50|YPw05Nd{J^%m! diff --git a/.gradle/7.0/fileHashes/fileHashes.bin b/.gradle/7.0/fileHashes/fileHashes.bin index 9a49c7605e18abb05397e1a4ef686579a50748b5..aea671befee3de961f0a2258a8f7ddafe35b8b3c 100644 GIT binary patch delta 261 zcmeC2#5jL4;|3E6M)t|35(XN^!W)n8u#m8100Yn5|4?B4sQGAAsBQ*SoO5!lgoR3h zT4}7bL1-*g&>E%~MgzrnZdCjszR@5-e6pj*iF#w8h$av#g0R3Iv$g52POej>z8i1Q zl1`b}|tqhpfnwJCB5e(MAz;BDGL+78j bro5x?yZI`7UEJc?krGfXDG)8HN+2x&U${!! delta 44 vcmbO~nXz*c;|3E6MwZE@5(bl}N*M6`hXMu$hQf`CKg2g0tPr2<=y3u7pOh1; diff --git a/.gradle/7.0/fileHashes/fileHashes.lock b/.gradle/7.0/fileHashes/fileHashes.lock index 79bc694e53fd2db82d02750389b7d86c798d3b99..53516a08b514ade97dc63df15e80bae41c71a207 100644 GIT binary patch literal 17 TcmZS9k*g{Vk(WHq00G^#}0|bZx05J{&!2kdN literal 17 UcmZQx{m|rfm>^#}0|W>H05J&zyZ`_I diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index 06caadf4a4bf8811b29137e857316fe39badbfbc..915eed4ce09e836a33358b8a6ac22aef9ba50b84 100644 GIT binary patch delta 107 zcmdlxiShF!#tkMCjDnL*C01w{3vWEW!$QK60Sr77|3iWGqvoSgp}HARaofpPB^m?@ n)JkKe4MJm~g8q|zC7l^pZdCjszR{pSY_g-rpUK*uLNE*fI+rB_ delta 37 vcmV+=0NVfak^#Mv0kAX}0S=Qj7^ssC8F-VO89M=Cu_5>uu`sw6lR-%Q1ndqe diff --git a/.idea/.gitignore b/.idea/.gitignore index e5968a1..3da48de 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,6 +6,8 @@ /build/ !gradle-wrapper.jar +*.iws + # Cache of project .gradletasknamecache diff --git a/.idea/misc.xml b/.idea/misc.xml index 84c523c..9a2ce5e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java index a493812..a5dc0dd 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/Event.java @@ -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. */ diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/CharacterConfiguration.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/CharacterConfiguration.java deleted file mode 100644 index 501d86e..0000000 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/CharacterConfiguration.java +++ /dev/null @@ -1,4 +0,0 @@ -package uulm.teamname.marvelous.gamelibrary.json; - -public class CharacterConfiguration { -} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java index 3103439..9e165d3 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/JSON.java @@ -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. */ diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageType.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageType.java new file mode 100644 index 0000000..cbadd4d --- /dev/null +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageType.java @@ -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 +} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/FieldType.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/FieldType.java new file mode 100644 index 0000000..dd801cd --- /dev/null +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/FieldType.java @@ -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, +} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/PartyConfiguration.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/PartyConfiguration.java new file mode 100644 index 0000000..e0ebdac --- /dev/null +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/PartyConfiguration.java @@ -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; +} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/ScenarioConfig.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/ScenarioConfig.java new file mode 100644 index 0000000..66330fe --- /dev/null +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/config/ScenarioConfig.java @@ -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; +} diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageStructure.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/MessageStructure.java similarity index 92% rename from src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageStructure.java rename to src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/MessageStructure.java index 1438edd..978f992 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/json/MessageStructure.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/json/ingame/MessageStructure.java @@ -1,4 +1,4 @@ -package uulm.teamname.marvelous.gamelibrary.json; +package uulm.teamname.marvelous.gamelibrary.json.ingame; import uulm.teamname.marvelous.gamelibrary.events.Event; diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java index 24bea5c..319e722 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java @@ -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. */ diff --git a/team25.iml b/team25.iml new file mode 100644 index 0000000..43956c1 --- /dev/null +++ b/team25.iml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/team25.ipr b/team25.ipr new file mode 100644 index 0000000..bab52ea --- /dev/null +++ b/team25.ipr @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.6 + + + + + + + + + + + + +