Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-19 12:34:31 -07:00
committed by GitHub
parent 5825ffb95c
commit f560f88eb5
261 changed files with 2291 additions and 2036 deletions

View File

@@ -1,7 +1,5 @@
using System.Linq;
using Content.Server.Administration;
using Content.Server.Administration;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Shared.Console;
@@ -42,14 +40,14 @@ namespace Content.Server.Nuke.Commands
return CompletionResult.Empty;
}
var stations = _entityManager
.EntityQuery<StationDataComponent>()
.Select(stationData =>
{
var meta = _entityManager.GetComponent<MetaDataComponent>(stationData.Owner);
var stations = new List<CompletionOption>();
var query = _entityManager.EntityQueryEnumerator<StationDataComponent>();
while (query.MoveNext(out var uid, out var stationData))
{
var meta = _entityManager.GetComponent<MetaDataComponent>(uid);
return new CompletionOption(stationData.Owner.ToString(), meta.EntityName);
});
stations.Add(new CompletionOption(uid.ToString(), meta.EntityName));
}
return CompletionResult.FromHintOptions(stations, null);
}