refactor: changed AssignmentEnum's name to ParticipantType

This commit is contained in:
Yannik Bretschneider 2021-06-03 23:38:43 +02:00
parent d4e0ed23bc
commit 78d3fb84d0
5 changed files with 8 additions and 12 deletions

View File

@ -1,6 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.messages;
public enum AssignmentEnum {
public enum ParticipantType {
PlayerOne,
PlayerTwo,
Spectator

View File

@ -6,7 +6,7 @@ import uulm.teamname.marvelous.gamelibrary.config.CharacterConfig;
import uulm.teamname.marvelous.gamelibrary.config.CharacterProperties;
import uulm.teamname.marvelous.gamelibrary.config.PartyConfig;
import uulm.teamname.marvelous.gamelibrary.config.ScenarioConfig;
import uulm.teamname.marvelous.gamelibrary.messages.AssignmentEnum;
import uulm.teamname.marvelous.gamelibrary.messages.ParticipantType;
import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage;
import uulm.teamname.marvelous.gamelibrary.messages.MessageType;
@ -28,7 +28,7 @@ public class GameStructureMessage extends BasicMessage {
public final MessageType messageType = MessageType.GAME_STRUCTURE;
/** The role the client has been assigned to */
public AssignmentEnum assignment;
public ParticipantType assignment;
/** The name of the first player */
public String playerOneName;

View File

@ -1,10 +1,7 @@
package uulm.teamname.marvelous.gamelibrary.json;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*;
@ -19,8 +16,7 @@ import uulm.teamname.marvelous.gamelibrary.events.Event;
import uulm.teamname.marvelous.gamelibrary.events.EventBuilder;
import uulm.teamname.marvelous.gamelibrary.events.EventType;
import uulm.teamname.marvelous.gamelibrary.events.GamestateEvent;
import uulm.teamname.marvelous.gamelibrary.messages.AssignmentEnum;
import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage;
import uulm.teamname.marvelous.gamelibrary.messages.ParticipantType;
import uulm.teamname.marvelous.gamelibrary.messages.ErrorMessage;
import uulm.teamname.marvelous.gamelibrary.messages.RoleEnum;
import uulm.teamname.marvelous.gamelibrary.messages.client.*;
@ -361,7 +357,7 @@ class JSONTest {
var message = new GameStructureMessage();
// message.messageType = MessageType.GAME_STRUCTURE;
message.assignment = AssignmentEnum.PlayerOne;
message.assignment = ParticipantType.PlayerOne;
message.playerOneName = "Gandalf";
message.playerTwoName = "Bilbo";
message.playerOneCharacters = new CharacterProperties[] {racoon, quicksilver, hulk};
@ -1071,7 +1067,7 @@ class JSONTest {
var message = new GameStructureMessage();
// message.messageType = MessageType.GAME_STRUCTURE;
message.assignment = AssignmentEnum.PlayerOne;
message.assignment = ParticipantType.PlayerOne;
message.playerOneName = "Gandalf";
message.playerTwoName = "Bilbo";
message.playerOneCharacters = new CharacterProperties[] {racoon, quicksilver, hulk};

View File

@ -333,7 +333,7 @@ public class MessageDeserializationTest {
var message = new GameStructureMessage();
// message.messageType = MessageType.GAME_STRUCTURE;
message.assignment = AssignmentEnum.PlayerOne;
message.assignment = ParticipantType.PlayerOne;
message.playerOneName = "Gandalf";
message.playerTwoName = "Bilbo";
message.playerOneCharacters = new CharacterProperties[] {racoon, quicksilver, hulk};

View File

@ -345,7 +345,7 @@ public class MessageSerializationTest {
var message = new GameStructureMessage();
// message.messageType = MessageType.GAME_STRUCTURE;
message.assignment = AssignmentEnum.PlayerOne;
message.assignment = ParticipantType.PlayerOne;
message.playerOneName = "Gandalf";
message.playerTwoName = "Bilbo";
message.playerOneCharacters = new CharacterProperties[] {racoon, quicksilver, hulk};