using Robust.Server.GameObjects; using Robust.Shared.Console; using Robust.Shared.GameObjects; using Robust.Shared.IoC; namespace Robust.Server.Console.Commands { public sealed class DeleteCommand : IConsoleCommand { public string Command => "delete"; public string Description => "Deletes the entity with the specified ID."; public string Help => "delete "; public void Execute(IConsoleShell shell, string argStr, string[] args) { if (args.Length != 1) { shell.WriteLine("You should provide exactly one argument."); return; } var ent = IoCManager.Resolve(); if (!EntityUid.TryParse(args[0], out var entity)) { shell.WriteLine("Invalid entity UID."); return; } if (!ent.EntityExists(entity)) { shell.WriteLine("That entity does not exist."); return; } ent.DeleteEntity(entity); } } }