diff --git a/OpenRA.Game/GameRules/ActorInfo.cs b/OpenRA.Game/GameRules/ActorInfo.cs index 51129ec768..03e4f11769 100644 --- a/OpenRA.Game/GameRules/ActorInfo.cs +++ b/OpenRA.Game/GameRules/ActorInfo.cs @@ -114,7 +114,7 @@ namespace OpenRA return info .GetType() .GetInterfaces() - .Where( t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof( ITraitPrerequisite<> ) ) + .Where( t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof( Requires<> ) ) .Select( t => t.GetGenericArguments()[ 0 ] ) .ToList(); } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index d164d9bdf2..3864faaf05 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -190,7 +190,7 @@ namespace OpenRA.Traits public class TraitInfo : ITraitInfo where T : new() { public virtual object Create(ActorInitializer init) { return new T(); } } - public interface ITraitPrerequisite where T : ITraitInfo { } + public interface Requires where T : ITraitInfo { } public interface INotifySelection { void SelectionChanged(); } public interface IWorldLoaded { void WorldLoaded(World w); } diff --git a/OpenRA.Mods.Cnc/DeadBuildingState.cs b/OpenRA.Mods.Cnc/DeadBuildingState.cs index 5f8fa0ae50..5ee2706e09 100644 --- a/OpenRA.Mods.Cnc/DeadBuildingState.cs +++ b/OpenRA.Mods.Cnc/DeadBuildingState.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc { - class DeadBuildingStateInfo : ITraitInfo, ITraitPrerequisite, ITraitPrerequisite + class DeadBuildingStateInfo : ITraitInfo, Requires, Requires { public readonly int LingerTime = 20; public readonly bool Zombie = false; // Civilian structures stick around after death diff --git a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs index f061587003..f6c0eef37d 100644 --- a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs @@ -22,7 +22,7 @@ using OpenRA.Widgets; namespace OpenRA.Mods.Cnc { - class Gdi01ScriptInfo : TraitInfo, ITraitPrerequisite { } + class Gdi01ScriptInfo : TraitInfo, Requires { } class Gdi01Script: IWorldLoaded, ITick { diff --git a/OpenRA.Mods.Cnc/RenderCargo.cs b/OpenRA.Mods.Cnc/RenderCargo.cs index 4d8f956f41..a7c461ad0c 100644 --- a/OpenRA.Mods.Cnc/RenderCargo.cs +++ b/OpenRA.Mods.Cnc/RenderCargo.cs @@ -8,15 +8,15 @@ */ #endregion +using System; using System.Collections.Generic; +using System.Linq; using OpenRA.Traits; using OpenRA.Mods.RA; -using System; -using System.Linq; namespace OpenRA.Mods.Cnc { - class RenderCargoInfo : ITraitInfo, ITraitPrerequisite + class RenderCargoInfo : ITraitInfo, Requires { public object Create(ActorInitializer init) { return new RenderCargo(init.self); } } diff --git a/OpenRA.Mods.Cnc/WithRoof.cs b/OpenRA.Mods.Cnc/WithRoof.cs index 5e9b6e8e1c..6f74b6c1ed 100644 --- a/OpenRA.Mods.Cnc/WithRoof.cs +++ b/OpenRA.Mods.Cnc/WithRoof.cs @@ -15,7 +15,7 @@ using OpenRA.Graphics; namespace OpenRA.Mods.Cnc { - public class WithRoofInfo : ITraitInfo, ITraitPrerequisite + public class WithRoofInfo : ITraitInfo, Requires { public object Create(ActorInitializer init) { return new WithRoof(init.self); } } diff --git a/OpenRA.Mods.RA/Air/TargetableAircraft.cs b/OpenRA.Mods.RA/Air/TargetableAircraft.cs index 53eec22418..e84b4b334c 100755 --- a/OpenRA.Mods.RA/Air/TargetableAircraft.cs +++ b/OpenRA.Mods.RA/Air/TargetableAircraft.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Air { - public class TargetableAircraftInfo : TargetableUnitInfo, ITraitPrerequisite + public class TargetableAircraftInfo : TargetableUnitInfo, Requires { public readonly string[] GroundedTargetTypes = { }; public override object Create(ActorInitializer init) { return new TargetableAircraft(init.self, this); } diff --git a/OpenRA.Mods.RA/AutoHeal.cs b/OpenRA.Mods.RA/AutoHeal.cs index c7a36e0245..01a64aa366 100644 --- a/OpenRA.Mods.RA/AutoHeal.cs +++ b/OpenRA.Mods.RA/AutoHeal.cs @@ -14,7 +14,7 @@ using OpenRA.Traits.Activities; namespace OpenRA.Mods.RA { - class AutoHealInfo : TraitInfo, ITraitPrerequisite { } + class AutoHealInfo : TraitInfo, Requires { } class AutoHeal : INotifyIdle { diff --git a/OpenRA.Mods.RA/AutoTarget.cs b/OpenRA.Mods.RA/AutoTarget.cs index b35d40cdd1..3c092d536d 100644 --- a/OpenRA.Mods.RA/AutoTarget.cs +++ b/OpenRA.Mods.RA/AutoTarget.cs @@ -15,7 +15,7 @@ using System.Linq; namespace OpenRA.Mods.RA { - public class AutoTargetInfo : ITraitInfo, ITraitPrerequisite + public class AutoTargetInfo : ITraitInfo, Requires { public readonly bool AllowMovement = true; public readonly int ScanRadius = -1; diff --git a/OpenRA.Mods.RA/Bridge.cs b/OpenRA.Mods.RA/Bridge.cs index f5a06f23cc..3aff7dbfb1 100644 --- a/OpenRA.Mods.RA/Bridge.cs +++ b/OpenRA.Mods.RA/Bridge.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class BridgeInfo : ITraitInfo, ITraitPrerequisite + class BridgeInfo : ITraitInfo, Requires { public readonly bool Long = false; diff --git a/OpenRA.Mods.RA/Buildings/PowerManager.cs b/OpenRA.Mods.RA/Buildings/PowerManager.cs index 463916cc4c..e37c81bc0e 100755 --- a/OpenRA.Mods.RA/Buildings/PowerManager.cs +++ b/OpenRA.Mods.RA/Buildings/PowerManager.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Buildings { - public class PowerManagerInfo : ITraitInfo, ITraitPrerequisite + public class PowerManagerInfo : ITraitInfo, Requires { public readonly int AdviceInterval = 250; public object Create(ActorInitializer init) { return new PowerManager(init, this); } diff --git a/OpenRA.Mods.RA/Buildings/RepairableBuilding.cs b/OpenRA.Mods.RA/Buildings/RepairableBuilding.cs index 5599d270f3..d8b1c7639d 100755 --- a/OpenRA.Mods.RA/Buildings/RepairableBuilding.cs +++ b/OpenRA.Mods.RA/Buildings/RepairableBuilding.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Buildings { - public class RepairableBuildingInfo : ITraitInfo, ITraitPrerequisite + public class RepairableBuildingInfo : ITraitInfo, Requires { public readonly int RepairPercent = 20; public readonly int RepairInterval = 24; diff --git a/OpenRA.Mods.RA/Buildings/Wall.cs b/OpenRA.Mods.RA/Buildings/Wall.cs index 0e42d685f5..da22175d29 100755 --- a/OpenRA.Mods.RA/Buildings/Wall.cs +++ b/OpenRA.Mods.RA/Buildings/Wall.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Buildings { - public class WallInfo : ITraitInfo, ITraitPrerequisite + public class WallInfo : ITraitInfo, Requires { public readonly string[] CrushClasses = { }; public readonly string CrushSound; diff --git a/OpenRA.Mods.RA/Crate.cs b/OpenRA.Mods.RA/Crate.cs index 7dcb2f7c09..b01bc44a52 100644 --- a/OpenRA.Mods.RA/Crate.cs +++ b/OpenRA.Mods.RA/Crate.cs @@ -27,7 +27,7 @@ TimeQuake=3,TQUAKE ; time quake namespace OpenRA.Mods.RA { - class CrateInfo : ITraitInfo, ITraitPrerequisite + class CrateInfo : ITraitInfo, Requires { public readonly int Lifetime = 5; // Seconds public readonly string[] TerrainTypes = { }; diff --git a/OpenRA.Mods.RA/Effects/GpsDot.cs b/OpenRA.Mods.RA/Effects/GpsDot.cs index fa0aeaf68e..78af0132a2 100644 --- a/OpenRA.Mods.RA/Effects/GpsDot.cs +++ b/OpenRA.Mods.RA/Effects/GpsDot.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Effects { - class GpsDotInfo : ITraitInfo, ITraitPrerequisite + class GpsDotInfo : ITraitInfo, Requires { public readonly string String = "Infantry"; public object Create(ActorInitializer init) diff --git a/OpenRA.Mods.RA/GainsExperience.cs b/OpenRA.Mods.RA/GainsExperience.cs index 5e21fdf478..cacf003aff 100644 --- a/OpenRA.Mods.RA/GainsExperience.cs +++ b/OpenRA.Mods.RA/GainsExperience.cs @@ -18,7 +18,7 @@ using OpenRA.FileFormats; namespace OpenRA.Mods.RA { - public class GainsExperienceInfo : ITraitInfo, ITraitPrerequisite + public class GainsExperienceInfo : ITraitInfo, Requires { public readonly float[] CostThreshold = { 2, 4, 8, 16 }; public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f }; diff --git a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs index d692eeb4d8..0ad9531e24 100755 --- a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - public class ClassicProductionQueueInfo : ProductionQueueInfo, ITraitPrerequisite, ITraitPrerequisite, ITraitPrerequisite + public class ClassicProductionQueueInfo : ProductionQueueInfo, Requires, Requires, Requires { public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); } } diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index 5d94a7468b..1e1c853656 100755 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.RA.Effects; namespace OpenRA.Mods.RA { - class RallyPointInfo : ITraitInfo, ITraitPrerequisite + class RallyPointInfo : ITraitInfo, Requires { public readonly int[] RallyPoint = { 1, 3 }; diff --git a/OpenRA.Mods.RA/Render/RenderInfantry.cs b/OpenRA.Mods.RA/Render/RenderInfantry.cs index d9397f1fa5..e17f810ea0 100644 --- a/OpenRA.Mods.RA/Render/RenderInfantry.cs +++ b/OpenRA.Mods.RA/Render/RenderInfantry.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.RA.Move; namespace OpenRA.Mods.RA.Render { - public class RenderInfantryInfo : RenderSimpleInfo, ITraitPrerequisite + public class RenderInfantryInfo : RenderSimpleInfo, Requires { public readonly int MinIdleWaitTicks = 30; public readonly int MaxIdleWaitTicks = 110; diff --git a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs index cfb2c87870..dff1c73056 100644 --- a/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.RA/Render/WithMuzzleFlash.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Render { - class WithMuzzleFlashInfo : ITraitInfo, ITraitPrerequisite + class WithMuzzleFlashInfo : ITraitInfo, Requires { public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.self); } } diff --git a/OpenRA.Mods.RA/Repairable.cs b/OpenRA.Mods.RA/Repairable.cs index adb63bb6b8..730e15b69c 100644 --- a/OpenRA.Mods.RA/Repairable.cs +++ b/OpenRA.Mods.RA/Repairable.cs @@ -20,7 +20,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RepairableInfo : ITraitInfo, ITraitPrerequisite + class RepairableInfo : ITraitInfo, Requires { public readonly string[] RepairBuildings = { "fix" }; public virtual object Create(ActorInitializer init) { return new Repairable(init.self); } diff --git a/OpenRA.Mods.RA/RepairableNear.cs b/OpenRA.Mods.RA/RepairableNear.cs index 1fa82ffba8..ed40d60c71 100644 --- a/OpenRA.Mods.RA/RepairableNear.cs +++ b/OpenRA.Mods.RA/RepairableNear.cs @@ -19,7 +19,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RepairableNearInfo : ITraitInfo, ITraitPrerequisite + class RepairableNearInfo : ITraitInfo, Requires { [ActorReference] public readonly string[] Buildings = { "spen", "syrd" }; diff --git a/OpenRA.Mods.RA/ScaredyCat.cs b/OpenRA.Mods.RA/ScaredyCat.cs index c9eab8b77f..7512d5104c 100644 --- a/OpenRA.Mods.RA/ScaredyCat.cs +++ b/OpenRA.Mods.RA/ScaredyCat.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA } } - class RenderInfantryPanicInfo : RenderInfantryInfo, ITraitPrerequisite + class RenderInfantryPanicInfo : RenderInfantryInfo, Requires { public override object Create(ActorInitializer init) { return new RenderInfantryPanic(init.self, this); } } diff --git a/OpenRA.Mods.RA/SelfHealing.cs b/OpenRA.Mods.RA/SelfHealing.cs index d2c3cb71f1..2f1810e885 100644 --- a/OpenRA.Mods.RA/SelfHealing.cs +++ b/OpenRA.Mods.RA/SelfHealing.cs @@ -12,7 +12,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class SelfHealingInfo : ITraitInfo, ITraitPrerequisite + class SelfHealingInfo : ITraitInfo, Requires { public readonly int Step = 5; public readonly int Ticks = 5; diff --git a/OpenRA.Mods.RA/SpawnMPUnits.cs b/OpenRA.Mods.RA/SpawnMPUnits.cs index fbb7e9826e..b5d2653413 100644 --- a/OpenRA.Mods.RA/SpawnMPUnits.cs +++ b/OpenRA.Mods.RA/SpawnMPUnits.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class SpawnMPUnitsInfo : TraitInfo, ITraitPrerequisite {} + class SpawnMPUnitsInfo : TraitInfo, Requires {} class SpawnMPUnits : IWorldLoaded { diff --git a/OpenRA.Mods.RA/Spy.cs b/OpenRA.Mods.RA/Spy.cs index de377cee35..c56325b8cb 100644 --- a/OpenRA.Mods.RA/Spy.cs +++ b/OpenRA.Mods.RA/Spy.cs @@ -19,7 +19,7 @@ using OpenRA.Mods.RA.Render; namespace OpenRA.Mods.RA { - class SpyToolTipInfo : TooltipInfo, ITraitPrerequisite + class SpyToolTipInfo : TooltipInfo, Requires { public override object Create (ActorInitializer init) { return new SpyToolTip(init.self, this); } } diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs index ba8bc688ef..145fc23b3d 100755 --- a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs @@ -8,15 +8,15 @@ */ #endregion +using System.Collections.Generic; using System.Linq; using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; -using System.Collections.Generic; using OpenRA.Graphics; namespace OpenRA.Mods.RA { - public class SupportPowerManagerInfo : ITraitInfo, ITraitPrerequisite + public class SupportPowerManagerInfo : ITraitInfo, Requires { public object Create(ActorInitializer init) { return new SupportPowerManager(init); } } diff --git a/OpenRA.Mods.RA/TakeCover.cs b/OpenRA.Mods.RA/TakeCover.cs index 697a76a9d8..c325b22e3e 100644 --- a/OpenRA.Mods.RA/TakeCover.cs +++ b/OpenRA.Mods.RA/TakeCover.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA } } - class RenderInfantryProneInfo : RenderInfantryInfo, ITraitPrerequisite + class RenderInfantryProneInfo : RenderInfantryInfo, Requires { public override object Create(ActorInitializer init) { return new RenderInfantryProne(init.self, this); } } diff --git a/OpenRA.Mods.RA/TargetableBuilding.cs b/OpenRA.Mods.RA/TargetableBuilding.cs index 82577f400c..4935ce9cdf 100755 --- a/OpenRA.Mods.RA/TargetableBuilding.cs +++ b/OpenRA.Mods.RA/TargetableBuilding.cs @@ -9,13 +9,13 @@ #endregion using System.Collections.Generic; +using System.Linq; using OpenRA.Mods.RA.Buildings; using OpenRA.Traits; -using System.Linq; namespace OpenRA.Mods.RA { - class TargetableBuildingInfo : ITraitInfo, ITraitPrerequisite + class TargetableBuildingInfo : ITraitInfo, Requires { public readonly string[] TargetTypes = { }; public object Create( ActorInitializer init ) { return new TargetableBuilding( this ); } diff --git a/OpenRA.Mods.RA/TargetableSubmarine.cs b/OpenRA.Mods.RA/TargetableSubmarine.cs index 05818e74e1..2abc83a923 100644 --- a/OpenRA.Mods.RA/TargetableSubmarine.cs +++ b/OpenRA.Mods.RA/TargetableSubmarine.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - public class TargetableSubmarineInfo : TargetableUnitInfo, ITraitPrerequisite + public class TargetableSubmarineInfo : TargetableUnitInfo, Requires { public readonly string[] CloakedTargetTypes = {}; public override object Create( ActorInitializer init ) { return new TargetableSubmarine(init.self, this); }