From 326c469e557a353af4479cf40930f86c677c7f43 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sun, 2 May 2021 03:15:20 +0200 Subject: [PATCH] fix: changed event types to non-primitives for nullability --- .../marvelous/gamelibrary/events/GameEvent.java | 10 +++++----- .../marvelous/gamelibrary/events/GameStateEvent.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java index a69a688..57ff1aa 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java @@ -9,15 +9,15 @@ import java.util.Objects; /** Represents a game event for: {@link EventType#RoundSetupEvent}, {@link EventType#TurnEvent}, {@link EventType#WinEvent}, {@link EventType#TurnTimeoutEvent}, {@link EventType#TimeoutWarningEvent}, {@link EventType#TimeoutEvent}, {@link EventType#DisconnectEvent}. */ public class GameEvent extends Event { - public int roundCount; - public int turnCount; + public Integer roundCount; + public Integer turnCount; public EntityID[] characterOrder; public EntityID nextCharacter; - public int playerWon; + public Integer playerWon; public String message; - public int timeLeft; + public Integer timeLeft; @Override public boolean equals(Object o) { @@ -25,7 +25,7 @@ public class GameEvent extends Event { if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; GameEvent gameEvent = (GameEvent) o; - return roundCount == gameEvent.roundCount && turnCount == gameEvent.turnCount && playerWon == gameEvent.playerWon && timeLeft == gameEvent.timeLeft && Arrays.equals(characterOrder, gameEvent.characterOrder) && Objects.equals(nextCharacter, gameEvent.nextCharacter) && Objects.equals(message, gameEvent.message); + return Objects.equals(roundCount, gameEvent.roundCount) && Objects.equals(turnCount, gameEvent.turnCount) && Objects.equals(playerWon, gameEvent.playerWon) && Objects.equals(timeLeft, gameEvent.timeLeft) && Arrays.equals(characterOrder, gameEvent.characterOrder) && Objects.equals(nextCharacter, gameEvent.nextCharacter) && Objects.equals(message, gameEvent.message); } @Override diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameStateEvent.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameStateEvent.java index 348dfef..2c0c656 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameStateEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameStateEvent.java @@ -11,7 +11,7 @@ public class GameStateEvent extends Event { public Entity[] entities; public EntityID[] turnOrder; public EntityID activeCharacter; - public boolean winCondition; + public Boolean winCondition; @Override public boolean equals(Object o) {