Skip to content

Commit ad6185a

Browse files
Lazzi0706Lazzi0706DexlerXD
authored
clearupgarbage command (#706)
* ... * small code refactor * deleted garbage file * added ss220 comment --------- Co-authored-by: Lazzi0706 <[email protected]> Co-authored-by: Dexler <[email protected]>
1 parent 698b72a commit ad6185a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Content.Server/Administration/Commands/GarbageClearUpCommand.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ public sealed partial class GarbageClearUpCommand : IConsoleCommand
1212
{
1313
[Dependency] private readonly IEntityManager _entMan = default!;
1414

15-
public string Command => "ClearUpGarbage";
16-
public string Description => "Removes all objects with a tag 'trash' from the map";
17-
public string Help => "Surgery tommorow";
15+
//SS220-clearupgarbage
16+
public string Command => "clearupgarbage";
17+
public string Description => "Удаляет весь мусор с карты (применимо к объектам с тегом 'trash')";
18+
public string Help => $"Usage: {Command} ... surgery tommorow";
1819

1920
public void Execute(IConsoleShell shell, string argStr, string[] args)
2021
{
2122
var _containerSystem = _entMan.System<SharedContainerSystem>();
22-
int cnt = 0;
23+
int processed = 0;
2324
foreach (var ent in _entMan.GetEntities())
2425
{
2526
if (!_entMan.TryGetComponent<TagComponent>(ent, out var component))
@@ -28,9 +29,9 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
2829
continue;
2930

3031
_entMan.DeleteEntity(ent);
31-
cnt++;
32+
processed++;
3233
}
33-
shell.WriteLine($"Карта очищена от {cnt} объектов мусора!");
34+
shell.WriteLine($"Удалено {processed} энтити.");
3435
}
3536
}
36-
}
37+
}

0 commit comments

Comments
 (0)