entitysystemupdateorder debug command

This commit is contained in:
Pieter-Jan Briers
2023-08-06 00:24:20 +02:00
parent bdd65cda4b
commit 2446e64033
3 changed files with 37 additions and 0 deletions

View File

@@ -161,3 +161,9 @@ command-description-EqualCommand =
Performs an equality comparison, returning true if the inputs are equal.
command-description-NotEqualCommand =
Performs an equality comparison, returning true if the inputs are not equal.
command-description-entitysystemupdateorder-tick =
Lists the tick update order of entity systems.
command-description-entitysystemupdateorder-frame =
Lists the frame update order of entity systems.

View File

@@ -393,6 +393,9 @@ namespace Robust.Shared.GameObjects
return mFrameUpdate!.DeclaringType != typeof(EntitySystem);
}
internal IEnumerable<Type> FrameUpdateOrder => _frameUpdateOrder.Select(c => c.GetType());
internal IEnumerable<Type> TickUpdateOrder => _updateOrder.Select(c => c.System.GetType());
private struct UpdateReg
{
[ViewVariables] public IEntitySystem System;

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using Robust.Shared.IoC;
using Robust.Shared.Toolshed;
namespace Robust.Shared.GameObjects;
[ToolshedCommand]
internal sealed class EntitySystemUpdateOrderCommand : ToolshedCommand
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[CommandImplementation("tick")]
public IEnumerable<Type> Tick()
{
var mgr = (EntitySystemManager)_entitySystemManager;
return mgr.TickUpdateOrder;
}
[CommandImplementation("frame")]
public IEnumerable<Type> Frame()
{
var mgr = (EntitySystemManager)_entitySystemManager;
return mgr.FrameUpdateOrder;
}
}