Power stat and nuke codes commands get some LEC love. (#38585)
* commit * requested changes.
This commit is contained in:
@@ -3,25 +3,22 @@ using Content.Server.Power.EntitySystems;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Shared.Console;
|
||||
|
||||
namespace Content.Server.Power.Commands
|
||||
namespace Content.Server.Power.Commands;
|
||||
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public sealed class PowerStatCommand : LocalizedEntityCommands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Debug)]
|
||||
public sealed class PowerStatCommand : IConsoleCommand
|
||||
[Dependency] private readonly PowerNetSystem _powerNet = default!;
|
||||
|
||||
public override string Command => "powerstat";
|
||||
|
||||
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _e = default!;
|
||||
|
||||
public string Command => "powerstat";
|
||||
public string Description => "Shows statistics for pow3r";
|
||||
public string Help => "Usage: powerstat";
|
||||
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var stats = _e.System<PowerNetSystem>().GetStatistics();
|
||||
|
||||
shell.WriteLine($"networks: {stats.CountNetworks}");
|
||||
shell.WriteLine($"loads: {stats.CountLoads}");
|
||||
shell.WriteLine($"supplies: {stats.CountSupplies}");
|
||||
shell.WriteLine($"batteries: {stats.CountBatteries}");
|
||||
}
|
||||
var stats = _powerNet.GetStatistics();
|
||||
shell.WriteLine(Loc.GetString("cmd-powerstat-output",
|
||||
("networks", stats.CountNetworks),
|
||||
("loads", stats.CountLoads),
|
||||
("supplies", stats.CountSupplies),
|
||||
("batteries", stats.CountBatteries)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user