Refactor PowerManager and RequiresPower to use conditions

Instead of Actor.IsDisabled.
Added INotifyPowerLevelChanged interface to do so as efficiently as possible.
This commit is contained in:
reaperrr
2017-08-04 13:28:02 +02:00
committed by Pavel Penev
parent 6c02e3f2b7
commit 786a0eb07f
6 changed files with 122 additions and 49 deletions

View File

@@ -95,6 +95,9 @@ namespace OpenRA.Mods.Common.Traits
void AfterRepair(Actor self, Actor target);
}
[RequireExplicitImplementation]
public interface INotifyPowerLevelChanged { void PowerLevelChanged(Actor self); }
public interface INotifyBuildingPlaced { void BuildingPlaced(Actor self); }
public interface INotifyNuke { void Launching(Actor self); }
public interface INotifyBurstComplete { void FiredBurst(Actor self, Target target, Armament a); }