Improve the toString result in Position.

This commit is contained in:
Major-
2014-08-09 16:53:32 +01:00
parent 04a8a61f15
commit 17975206cb
+4 -1
View File
@@ -1,5 +1,7 @@
package org.apollo.game.model;
import com.google.common.base.Objects;
/**
* Represents a position in the world.
*
@@ -217,7 +219,8 @@ public final class Position {
@Override
public String toString() {
return Position.class.getName() + " [x=" + x + ", y=" + y + ", height=" + height + "]";
return Objects.toStringHelper(this).add("x", x).add("y", y).add("height", height)
.add("sector x", getTopLeftSectorX()).add("sector y", getTopLeftSectorY()).toString();
}
}