Make IsDisabled a method on Actor.
This allows us to cache the disabled traits, which simplifies life for some callers since we relieve them of having to cache it, as well as improving perf for all IsDisabled calls.
This commit is contained in:
@@ -329,14 +329,6 @@ namespace OpenRA.Traits
|
||||
void OnObjectiveFailed(Player player, int objectiveID);
|
||||
}
|
||||
|
||||
public static class DisableExts
|
||||
{
|
||||
public static bool IsDisabled(this Actor a)
|
||||
{
|
||||
return a.TraitsImplementing<IDisable>().Any(d => d.Disabled);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ILegacyEditorRenderInfo
|
||||
{
|
||||
string EditorPalette { get; }
|
||||
|
||||
Reference in New Issue
Block a user