fix: added eventType to toString methods of events

This commit is contained in:
Yannik Bretschneider 2021-05-13 14:21:32 +02:00
parent 868df160bb
commit 5701cedcf4
5 changed files with 49 additions and 1 deletions

View File

@ -74,4 +74,17 @@ public class CharacterEvent extends Event {
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), originEntity, targetEntity, originField, targetField, amount, stoneType); 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 +
'}';
}
} }

View File

@ -39,4 +39,13 @@ public class CustomEvent extends Event {
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), teamIdentifier, customContent); return Objects.hash(super.hashCode(), teamIdentifier, customContent);
} }
@Override
public String toString() {
return "CustomEvent{" +
"eventType=" + this.type +
", teamIdentifier='" + teamIdentifier + '\'' +
", customContent=" + customContent +
'}';
}
} }

View File

@ -63,4 +63,15 @@ public class EntityEvent extends Event {
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), targetEntity, targetField, amount); 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 +
'}';
}
} }

View File

@ -85,4 +85,18 @@ public class GameEvent extends Event {
result = 31 * result + Arrays.hashCode(characterOrder); result = 31 * result + Arrays.hashCode(characterOrder);
return result; 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 +
'}';
}
} }

View File

@ -61,7 +61,8 @@ public class GamestateEvent extends Event {
@Override @Override
public String toString() { public String toString() {
return "GamestateEvent{" + return "GamestateEvent{" +
"entities=" + Arrays.toString(entities) + "eventType=" + this.type +
", entities=" + Arrays.toString(entities) +
", turnOrder=" + Arrays.toString(turnOrder) + ", turnOrder=" + Arrays.toString(turnOrder) +
", mapSize=" + mapSize + ", mapSize=" + mapSize +
", activeCharacter=" + activeCharacter + ", activeCharacter=" + activeCharacter +