Added basic Cubot.toString() and fixed account page debug info

This commit is contained in:
Simon 2018-05-31 22:33:56 -04:00
parent ed1c4cff0b
commit b6a206f3c7
2 changed files with 13 additions and 1 deletions

View File

@ -664,4 +664,15 @@ public class Cubot extends GameObject implements Updatable, ControllableUnit, Me
//Overwrite item at current position
((CubotInventory) getHardware(CubotInventory.class)).putItem(item);
}
@Override
public String toString() {
StringBuilder str = new StringBuilder(super.toString());
str.append("\nHardware: \n");
for (Integer i : hardwareAddresses.keySet()) {
str.append(String.format("%04X", i)).append(":").append(hardwareAddresses.get(i)).append("\n");
}
return str.toString();
}
}

View File

@ -71,9 +71,10 @@
<p>Moderator: $user.isModerator()</p>
<h5>CPU</h5>
<pre>$user.getCpu()</pre>
<pre>$user.getControlledUnit().getCpu()</pre>
<h5>Controlled unit</h5>
<p>$user.getControlledUnit()</p>
<p>id: $user.getControlledUnit().getObjectId()</p>
<p>energy: $user.getControlledUnit().getEnergy()</p>
<p>x: $user.getControlledUnit().getX()</p>