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

@@ -24,7 +24,14 @@ using OpenRA.Widgets;
namespace OpenRA
{
public enum PowerState { Normal, Low, Critical }
[Flags]
public enum PowerState
{
Normal = 1,
Low = 2,
Critical = 4
}
public enum WinState { Undefined, Won, Lost }
public class Player : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILuaEqualityBinding, ILuaToStringBinding