ListGasesCommand.cs 925 B

1234567891011121314151617181920212223242526272829
  1. using Content.Server.Administration;
  2. using Content.Server.Atmos.EntitySystems;
  3. using Content.Shared.Administration;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Atmos.Commands
  6. {
  7. [AdminCommand(AdminFlags.Debug)]
  8. public sealed class ListGasesCommand : IConsoleCommand
  9. {
  10. [Dependency] private readonly IEntityManager _e = default!;
  11. public string Command => "listgases";
  12. public string Description => "Prints a list of gases and their indices.";
  13. public string Help => "listgases";
  14. public void Execute(IConsoleShell shell, string argStr, string[] args)
  15. {
  16. var atmosSystem = _e.System<AtmosphereSystem>();
  17. foreach (var gasPrototype in atmosSystem.Gases)
  18. {
  19. var gasName = Loc.GetString(gasPrototype.Name);
  20. shell.WriteLine($"{gasName} ID: {gasPrototype.ID}");
  21. }
  22. }
  23. }
  24. }