From 97b23f67fbbbd1c1d0f69427ea2a629103146f58 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 14 Apr 2016 16:06:27 +0200 Subject: Generate toString methods for debugging --- src/ch/epfl/xblast/server/Bomb.java | 10 ++++++++++ src/ch/epfl/xblast/server/Player.java | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'src/ch/epfl') diff --git a/src/ch/epfl/xblast/server/Bomb.java b/src/ch/epfl/xblast/server/Bomb.java index 9a3fa63..a99a8cb 100644 --- a/src/ch/epfl/xblast/server/Bomb.java +++ b/src/ch/epfl/xblast/server/Bomb.java @@ -134,4 +134,14 @@ public final class Bomb { .collect(Collectors.toList()); } + @Override + public String toString() { + return "Bomb{" + + "ownerId=" + ownerId + + ", position=" + position + + ", fuseLengths=" + fuseLengths + + ", range=" + range + + '}'; + } + } diff --git a/src/ch/epfl/xblast/server/Player.java b/src/ch/epfl/xblast/server/Player.java index e8f3145..414be71 100644 --- a/src/ch/epfl/xblast/server/Player.java +++ b/src/ch/epfl/xblast/server/Player.java @@ -70,6 +70,14 @@ public final class Player { return this.state() == State.INVULNERABLE || this.state() == State.VULNERABLE; } + @Override + public String toString() { + return "LifeState{" + + "lives=" + lives + + ", state=" + state + + '}'; + } + } /** @@ -146,6 +154,14 @@ public final class Player { return new DirectedPosition(this.position(), newDirection); } + @Override + public String toString() { + return "DirectedPosition{" + + "position=" + position + + ", direction=" + direction + + '}'; + } + } /** -- cgit v1.2.3