Replace all T : Component constraints with T : IComponent (#21073)
This commit is contained in:
@@ -65,7 +65,7 @@ public abstract class SharedRoleSystem : EntitySystem
|
||||
/// <exception cref="ArgumentException">
|
||||
/// Thrown if we already have a role with this type.
|
||||
/// </exception>
|
||||
public void MindAddRole<T>(EntityUid mindId, T component, MindComponent? mind = null, bool silent = false) where T : Component, new()
|
||||
public void MindAddRole<T>(EntityUid mindId, T component, MindComponent? mind = null, bool silent = false) where T : IComponent, new()
|
||||
{
|
||||
if (!Resolve(mindId, ref mind))
|
||||
return;
|
||||
@@ -99,7 +99,7 @@ public abstract class SharedRoleSystem : EntitySystem
|
||||
/// <exception cref="ArgumentException">
|
||||
/// Thrown if we do not have this role.
|
||||
/// </exception>
|
||||
public void MindRemoveRole<T>(EntityUid mindId) where T : Component
|
||||
public void MindRemoveRole<T>(EntityUid mindId) where T : IComponent
|
||||
{
|
||||
if (!RemComp<T>(mindId))
|
||||
{
|
||||
@@ -118,7 +118,7 @@ public abstract class SharedRoleSystem : EntitySystem
|
||||
$"'Role {typeof(T).Name}' removed from mind of {_minds.MindOwnerLoggingString(mind)}");
|
||||
}
|
||||
|
||||
public bool MindTryRemoveRole<T>(EntityUid mindId) where T : Component
|
||||
public bool MindTryRemoveRole<T>(EntityUid mindId) where T : IComponent
|
||||
{
|
||||
if (!MindHasRole<T>(mindId))
|
||||
return false;
|
||||
@@ -127,7 +127,7 @@ public abstract class SharedRoleSystem : EntitySystem
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool MindHasRole<T>(EntityUid mindId) where T : Component
|
||||
public bool MindHasRole<T>(EntityUid mindId) where T : IComponent
|
||||
{
|
||||
return HasComp<T>(mindId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user