From 5701cedcf4bceb6fc23527518beddc4ae61f0372 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 13 May 2021 14:21:32 +0200 Subject: [PATCH] fix: added eventType to toString methods of events --- .../gamelibrary/events/CharacterEvent.java | 13 +++++++++++++ .../marvelous/gamelibrary/events/CustomEvent.java | 9 +++++++++ .../marvelous/gamelibrary/events/EntityEvent.java | 11 +++++++++++ .../marvelous/gamelibrary/events/GameEvent.java | 14 ++++++++++++++ .../gamelibrary/events/GamestateEvent.java | 3 ++- 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CharacterEvent.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CharacterEvent.java index 421b576..48dba8f 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CharacterEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CharacterEvent.java @@ -74,4 +74,17 @@ public class CharacterEvent extends Event { public int hashCode() { return Objects.hash(super.hashCode(), originEntity, targetEntity, originField, targetField, amount, stoneType); } + + @Override + public String toString() { + return "CharacterEvent{" + + "eventType=" + this.type + + ", originEntity=" + originEntity + + ", targetEntity=" + targetEntity + + ", originField=" + originField + + ", targetField=" + targetField + + ", amount=" + amount + + ", stoneType=" + stoneType + + '}'; + } } diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CustomEvent.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CustomEvent.java index 395f0a9..d79125a 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CustomEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/CustomEvent.java @@ -39,4 +39,13 @@ public class CustomEvent extends Event { public int hashCode() { return Objects.hash(super.hashCode(), teamIdentifier, customContent); } + + @Override + public String toString() { + return "CustomEvent{" + + "eventType=" + this.type + + ", teamIdentifier='" + teamIdentifier + '\'' + + ", customContent=" + customContent + + '}'; + } } diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/EntityEvent.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/EntityEvent.java index 58f8470..da77417 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/EntityEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/EntityEvent.java @@ -63,4 +63,15 @@ public class EntityEvent extends Event { public int hashCode() { return Objects.hash(super.hashCode(), targetEntity, targetField, amount); } + + @Override + public String toString() { + return "EntityEvent{" + + "eventType=" + this.type + + ", targetEntity=" + targetEntity + + ", targetField=" + targetField + + ", amount=" + amount + + ", entity=" + entity + + '}'; + } } 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 9b8fd74..f149918 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GameEvent.java @@ -85,4 +85,18 @@ public class GameEvent extends Event { result = 31 * result + Arrays.hashCode(characterOrder); return result; } + + @Override + public String toString() { + return "GameEvent{" + + "eventType=" + this.type + + ", roundCount=" + roundCount + + ", turnCount=" + turnCount + + ", characterOrder=" + Arrays.toString(characterOrder) + + ", nextCharacter=" + nextCharacter + + ", playerWon=" + playerWon + + ", message='" + message + '\'' + + ", timeLeft=" + timeLeft + + '}'; + } } 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 2a8db2c..8e7816d 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GamestateEvent.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/events/GamestateEvent.java @@ -61,7 +61,8 @@ public class GamestateEvent extends Event { @Override public String toString() { return "GamestateEvent{" + - "entities=" + Arrays.toString(entities) + + "eventType=" + this.type + + ", entities=" + Arrays.toString(entities) + ", turnOrder=" + Arrays.toString(turnOrder) + ", mapSize=" + mapSize + ", activeCharacter=" + activeCharacter +