Suggestion: Override BehaviorControl#debugString in GroupBehavior to return a bit more information
Thelnfamous1 opened this issue ยท 1 comments
I use Flemmli97's DebugUtils, which re-enables the vanilla debug renderers, to help with in-game debugging of Brains. When reading which behaviors are currently running, any instance of GroupBehavior
does not provide any more information beyond the name of the GroupBehavior
sub-class.
If you override BehaviorControl#debugString
in GroupBehavior
, you can format the debug string to not only provide the name of the GroupBehavior
sub-class, but the debug strings of the currently running behaviors. This can help diagnose which of the sub-behaviors of a GroupBehavior
are currently running when the vanilla debug renderer is re-enabled.
Example:
@Override public String debugString() { Set<String> runningBehaviors = this.behaviours.stream() .filter((behaviour) -> behaviour.getStatus() == Behavior.Status.RUNNING) .map(BehaviorControl::debugString) .collect(Collectors.toSet()); String name = this.getClass().getSimpleName(); return "(" + name + "): " + String.join(",", runningBehaviors); }