CatStation/Content.Server/Commands/ContentCompletionHelper.cs
Fildrance bb5f8d696a
Additional console commands for debugging Xeno Artifact (#41455)
* feat: xeno artifact debug commands

* refactor:  minor renaming + whitespaces

* refactor: do not allocate unless needed

* refactor: rename common xeno-artifact commands localization string

* refactor: extract reusable parts of code, change command to work with EntityUid and not with NetEntity

* refactor: renaming

* refactor: make all commands toolshed

* refactor: localization fix, command naming reverted to camelCase, xml-doc for new commands

* refactor: make toolshed tuple actually work

* refactor: remove unused code

* refactor: cache for EffectPrototypes

* refactor: fix unlcokNode command, remove engine copy-paste for TryParseEntity

* refactor: fix localization for toolshed

* refactor: remove unused dependency

* refactor: caching systems for XenoArtifactCommand where possible, comments clarification, whitespacing

* refactor: added readonly to SharedXenoArtifactSystem.EffectPrototypeIds

* refactor: use component to detect which proto is xenoarch effect

* refactor: fix missing partial for XenoArtifactCommand

* refactor: fix readonly on dependencies for XenoArtifactCommand

* refactor: fix missing partial for nested XenoArtifact related parsers

* refactor: cleanup after merge

* refactor: remove obsolete IPrototype.HasComponent call and unused using

* refactor: change xenoarch commands to lowercase (as convention dictates)

* refactor: XenoArtifactNodeParser and XenoArtifactTypeParser are now CustomCompletionParser (removed duplicate code)

* refactor: XenoArtifactNodeParser is now CustomCompletionParser, moved custom parsers to shared/toolshed/parsers

* refactor: todo for ent proto caching, moved XenoArtifactCommand to toolshed namespace

* refactor: fix xenoartifact:totalresearch command

* refactor: remove system caching, clean whitespaces

* fix: fix localization for xenoarch commands

* refactor: moved StatusEffectCompletionParser to shared, added same todo remark for cache of status effect entity prototypes.

* refactor: use proxy methods in command and  _entityManager.System in all parsers

* refactor: mved commands and parsers into respective folders

* refactor: access restriction for cached EntityPrototypeIds

* refactor: todo link to issue, fixed DI in StatusEffectCompletionParser

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
2026-07-31 17:48:45 +00:00

22 lines
731 B
C#

using Content.Shared.Station.Components;
using Robust.Shared.Console;
namespace Content.Server.Commands;
/// <summary>
/// Helper functions for programming console command completions.
/// </summary>
public static class ContentCompletionHelper
{
/// <summary>
/// Return all stations, with their ID as value and name as hint.
/// </summary>
public static IEnumerable<CompletionOption> StationIds(IEntityManager entityManager)
{
var query = entityManager.EntityQueryEnumerator<StationDataComponent, MetaDataComponent>();
while (query.MoveNext(out var uid, out _, out var metaData))
{
yield return new CompletionOption(uid.ToString(), metaData.EntityName);
}
}
}