Enable robots to check their energy level.

This commit is contained in:
Florian Nücke
2021-02-14 13:14:38 +01:00
parent 376f77cb22
commit 0efb515194

View File

@@ -868,6 +868,16 @@ public final class RobotEntity extends Entity implements Robot {
return actionProcessor.rotate(direction);
}
@Callback(synchronize = false)
public int getCurrentEnergy() {
return energy.getEnergyStored();
}
@Callback(synchronize = false)
public int getMaxEnergy() {
return energy.getMaxEnergyStored();
}
@Callback(synchronize = false)
public int getLastActionId() {
return actionProcessor.lastActionId;