Replace all T : Component constraints with T : IComponent (#21073)

This commit is contained in:
DrSmugleaf
2023-10-17 19:42:47 -07:00
committed by GitHub
parent a136616531
commit 5934c6728f
10 changed files with 25 additions and 29 deletions

View File

@@ -679,7 +679,7 @@ public partial class SharedBodySystem
public List<(T Comp, OrganComponent Organ)> GetBodyPartOrganComponents<T>(
EntityUid uid,
BodyPartComponent? part = null)
where T : Component
where T : IComponent
{
if (!Resolve(uid, ref part))
return new List<(T Comp, OrganComponent Organ)>();
@@ -709,7 +709,7 @@ public partial class SharedBodySystem
EntityUid uid,
[NotNullWhen(true)] out List<(T Comp, OrganComponent Organ)>? comps,
BodyPartComponent? part = null)
where T : Component
where T : IComponent
{
if (!Resolve(uid, ref part))
{
@@ -751,7 +751,7 @@ public partial class SharedBodySystem
public IEnumerable<(EntityUid AdjacentId, T Component)> GetBodyPartAdjacentPartsComponents<T>(
EntityUid partId,
BodyPartComponent? part = null)
where T : Component
where T : IComponent
{
if (!Resolve(partId, ref part, false))
yield break;
@@ -768,7 +768,7 @@ public partial class SharedBodySystem
EntityUid partId,
[NotNullWhen(true)] out List<(EntityUid AdjacentId, T Component)>? comps,
BodyPartComponent? part = null)
where T : Component
where T : IComponent
{
if (!Resolve(partId, ref part, false))
{