rename ITraitPrerequisite<T> to Requires<T>
This commit is contained in:
@@ -114,7 +114,7 @@ namespace OpenRA
|
|||||||
return info
|
return info
|
||||||
.GetType()
|
.GetType()
|
||||||
.GetInterfaces()
|
.GetInterfaces()
|
||||||
.Where( t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof( ITraitPrerequisite<> ) )
|
.Where( t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof( Requires<> ) )
|
||||||
.Select( t => t.GetGenericArguments()[ 0 ] )
|
.Select( t => t.GetGenericArguments()[ 0 ] )
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public class TraitInfo<T> : ITraitInfo where T : new() { public virtual object Create(ActorInitializer init) { return new T(); } }
|
public class TraitInfo<T> : ITraitInfo where T : new() { public virtual object Create(ActorInitializer init) { return new T(); } }
|
||||||
|
|
||||||
public interface ITraitPrerequisite<T> where T : ITraitInfo { }
|
public interface Requires<T> where T : ITraitInfo { }
|
||||||
|
|
||||||
public interface INotifySelection { void SelectionChanged(); }
|
public interface INotifySelection { void SelectionChanged(); }
|
||||||
public interface IWorldLoaded { void WorldLoaded(World w); }
|
public interface IWorldLoaded { void WorldLoaded(World w); }
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Cnc
|
namespace OpenRA.Mods.Cnc
|
||||||
{
|
{
|
||||||
class DeadBuildingStateInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>, ITraitPrerequisite<RenderSimpleInfo>
|
class DeadBuildingStateInfo : ITraitInfo, Requires<HealthInfo>, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public readonly int LingerTime = 20;
|
public readonly int LingerTime = 20;
|
||||||
public readonly bool Zombie = false; // Civilian structures stick around after death
|
public readonly bool Zombie = false; // Civilian structures stick around after death
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ using OpenRA.Widgets;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Cnc
|
namespace OpenRA.Mods.Cnc
|
||||||
{
|
{
|
||||||
class Gdi01ScriptInfo : TraitInfo<Gdi01Script>, ITraitPrerequisite<OpenWidgetAtGameStartInfo> { }
|
class Gdi01ScriptInfo : TraitInfo<Gdi01Script>, Requires<OpenWidgetAtGameStartInfo> { }
|
||||||
|
|
||||||
class Gdi01Script: IWorldLoaded, ITick
|
class Gdi01Script: IWorldLoaded, ITick
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
using OpenRA.Mods.RA;
|
using OpenRA.Mods.RA;
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace OpenRA.Mods.Cnc
|
namespace OpenRA.Mods.Cnc
|
||||||
{
|
{
|
||||||
class RenderCargoInfo : ITraitInfo, ITraitPrerequisite<CargoInfo>
|
class RenderCargoInfo : ITraitInfo, Requires<CargoInfo>
|
||||||
{
|
{
|
||||||
public object Create(ActorInitializer init) { return new RenderCargo(init.self); }
|
public object Create(ActorInitializer init) { return new RenderCargo(init.self); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using OpenRA.Graphics;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Cnc
|
namespace OpenRA.Mods.Cnc
|
||||||
{
|
{
|
||||||
public class WithRoofInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
|
public class WithRoofInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public object Create(ActorInitializer init) { return new WithRoof(init.self); }
|
public object Create(ActorInitializer init) { return new WithRoof(init.self); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Air
|
namespace OpenRA.Mods.RA.Air
|
||||||
{
|
{
|
||||||
public class TargetableAircraftInfo : TargetableUnitInfo, ITraitPrerequisite<AircraftInfo>
|
public class TargetableAircraftInfo : TargetableUnitInfo, Requires<AircraftInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] GroundedTargetTypes = { };
|
public readonly string[] GroundedTargetTypes = { };
|
||||||
public override object Create(ActorInitializer init) { return new TargetableAircraft(init.self, this); }
|
public override object Create(ActorInitializer init) { return new TargetableAircraft(init.self, this); }
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using OpenRA.Traits.Activities;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class AutoHealInfo : TraitInfo<AutoHeal>, ITraitPrerequisite<AttackBaseInfo> { }
|
class AutoHealInfo : TraitInfo<AutoHeal>, Requires<AttackBaseInfo> { }
|
||||||
|
|
||||||
class AutoHeal : INotifyIdle
|
class AutoHeal : INotifyIdle
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using System.Linq;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
public class AutoTargetInfo : ITraitInfo, ITraitPrerequisite<AttackBaseInfo>
|
public class AutoTargetInfo : ITraitInfo, Requires<AttackBaseInfo>
|
||||||
{
|
{
|
||||||
public readonly bool AllowMovement = true;
|
public readonly bool AllowMovement = true;
|
||||||
public readonly int ScanRadius = -1;
|
public readonly int ScanRadius = -1;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class BridgeInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
|
class BridgeInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
public readonly bool Long = false;
|
public readonly bool Long = false;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Buildings
|
namespace OpenRA.Mods.RA.Buildings
|
||||||
{
|
{
|
||||||
public class PowerManagerInfo : ITraitInfo, ITraitPrerequisite<DeveloperModeInfo>
|
public class PowerManagerInfo : ITraitInfo, Requires<DeveloperModeInfo>
|
||||||
{
|
{
|
||||||
public readonly int AdviceInterval = 250;
|
public readonly int AdviceInterval = 250;
|
||||||
public object Create(ActorInitializer init) { return new PowerManager(init, this); }
|
public object Create(ActorInitializer init) { return new PowerManager(init, this); }
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Buildings
|
namespace OpenRA.Mods.RA.Buildings
|
||||||
{
|
{
|
||||||
public class RepairableBuildingInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
|
public class RepairableBuildingInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
public readonly int RepairPercent = 20;
|
public readonly int RepairPercent = 20;
|
||||||
public readonly int RepairInterval = 24;
|
public readonly int RepairInterval = 24;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Buildings
|
namespace OpenRA.Mods.RA.Buildings
|
||||||
{
|
{
|
||||||
public class WallInfo : ITraitInfo, ITraitPrerequisite<BuildingInfo>
|
public class WallInfo : ITraitInfo, Requires<BuildingInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] CrushClasses = { };
|
public readonly string[] CrushClasses = { };
|
||||||
public readonly string CrushSound;
|
public readonly string CrushSound;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ TimeQuake=3,TQUAKE ; time quake
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class CrateInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
|
class CrateInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public readonly int Lifetime = 5; // Seconds
|
public readonly int Lifetime = 5; // Seconds
|
||||||
public readonly string[] TerrainTypes = { };
|
public readonly string[] TerrainTypes = { };
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Effects
|
namespace OpenRA.Mods.RA.Effects
|
||||||
{
|
{
|
||||||
class GpsDotInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
|
class GpsDotInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public readonly string String = "Infantry";
|
public readonly string String = "Infantry";
|
||||||
public object Create(ActorInitializer init)
|
public object Create(ActorInitializer init)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using OpenRA.FileFormats;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
public class GainsExperienceInfo : ITraitInfo, ITraitPrerequisite<ValuedInfo>
|
public class GainsExperienceInfo : ITraitInfo, Requires<ValuedInfo>
|
||||||
{
|
{
|
||||||
public readonly float[] CostThreshold = { 2, 4, 8, 16 };
|
public readonly float[] CostThreshold = { 2, 4, 8, 16 };
|
||||||
public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f };
|
public readonly float[] FirepowerModifier = { 1.1f, 1.15f, 1.2f, 1.5f };
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
public class ClassicProductionQueueInfo : ProductionQueueInfo, ITraitPrerequisite<TechTreeInfo>, ITraitPrerequisite<PowerManagerInfo>, ITraitPrerequisite<PlayerResourcesInfo>
|
public class ClassicProductionQueueInfo : ProductionQueueInfo, Requires<TechTreeInfo>, Requires<PowerManagerInfo>, Requires<PlayerResourcesInfo>
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); }
|
public override object Create(ActorInitializer init) { return new ClassicProductionQueue(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ using OpenRA.Mods.RA.Effects;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class RallyPointInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
|
class RallyPointInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public readonly int[] RallyPoint = { 1, 3 };
|
public readonly int[] RallyPoint = { 1, 3 };
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ using OpenRA.Mods.RA.Move;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Render
|
namespace OpenRA.Mods.RA.Render
|
||||||
{
|
{
|
||||||
public class RenderInfantryInfo : RenderSimpleInfo, ITraitPrerequisite<MobileInfo>
|
public class RenderInfantryInfo : RenderSimpleInfo, Requires<MobileInfo>
|
||||||
{
|
{
|
||||||
public readonly int MinIdleWaitTicks = 30;
|
public readonly int MinIdleWaitTicks = 30;
|
||||||
public readonly int MaxIdleWaitTicks = 110;
|
public readonly int MaxIdleWaitTicks = 110;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA.Render
|
namespace OpenRA.Mods.RA.Render
|
||||||
{
|
{
|
||||||
class WithMuzzleFlashInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
|
class WithMuzzleFlashInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||||
{
|
{
|
||||||
public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.self); }
|
public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.self); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class RepairableInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
|
class RepairableInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] RepairBuildings = { "fix" };
|
public readonly string[] RepairBuildings = { "fix" };
|
||||||
public virtual object Create(ActorInitializer init) { return new Repairable(init.self); }
|
public virtual object Create(ActorInitializer init) { return new Repairable(init.self); }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class RepairableNearInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
|
class RepairableNearInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
[ActorReference]
|
[ActorReference]
|
||||||
public readonly string[] Buildings = { "spen", "syrd" };
|
public readonly string[] Buildings = { "spen", "syrd" };
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenderInfantryPanicInfo : RenderInfantryInfo, ITraitPrerequisite<ScaredyCatInfo>
|
class RenderInfantryPanicInfo : RenderInfantryInfo, Requires<ScaredyCatInfo>
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new RenderInfantryPanic(init.self, this); }
|
public override object Create(ActorInitializer init) { return new RenderInfantryPanic(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class SelfHealingInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
|
class SelfHealingInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
public readonly int Step = 5;
|
public readonly int Step = 5;
|
||||||
public readonly int Ticks = 5;
|
public readonly int Ticks = 5;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class SpawnMPUnitsInfo : TraitInfo<SpawnMPUnits>, ITraitPrerequisite<MPStartLocationsInfo> {}
|
class SpawnMPUnitsInfo : TraitInfo<SpawnMPUnits>, Requires<MPStartLocationsInfo> {}
|
||||||
|
|
||||||
class SpawnMPUnits : IWorldLoaded
|
class SpawnMPUnits : IWorldLoaded
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using OpenRA.Mods.RA.Render;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class SpyToolTipInfo : TooltipInfo, ITraitPrerequisite<SpyInfo>
|
class SpyToolTipInfo : TooltipInfo, Requires<SpyInfo>
|
||||||
{
|
{
|
||||||
public override object Create (ActorInitializer init) { return new SpyToolTip(init.self, this); }
|
public override object Create (ActorInitializer init) { return new SpyToolTip(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Mods.RA.Buildings;
|
using OpenRA.Mods.RA.Buildings;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
public class SupportPowerManagerInfo : ITraitInfo, ITraitPrerequisite<DeveloperModeInfo>
|
public class SupportPowerManagerInfo : ITraitInfo, Requires<DeveloperModeInfo>
|
||||||
{
|
{
|
||||||
public object Create(ActorInitializer init) { return new SupportPowerManager(init); }
|
public object Create(ActorInitializer init) { return new SupportPowerManager(init); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenderInfantryProneInfo : RenderInfantryInfo, ITraitPrerequisite<TakeCoverInfo>
|
class RenderInfantryProneInfo : RenderInfantryInfo, Requires<TakeCoverInfo>
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new RenderInfantryProne(init.self, this); }
|
public override object Create(ActorInitializer init) { return new RenderInfantryProne(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using OpenRA.Mods.RA.Buildings;
|
using OpenRA.Mods.RA.Buildings;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class TargetableBuildingInfo : ITraitInfo, ITraitPrerequisite<BuildingInfo>
|
class TargetableBuildingInfo : ITraitInfo, Requires<BuildingInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] TargetTypes = { };
|
public readonly string[] TargetTypes = { };
|
||||||
public object Create( ActorInitializer init ) { return new TargetableBuilding( this ); }
|
public object Create( ActorInitializer init ) { return new TargetableBuilding( this ); }
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
public class TargetableSubmarineInfo : TargetableUnitInfo, ITraitPrerequisite<CloakInfo>
|
public class TargetableSubmarineInfo : TargetableUnitInfo, Requires<CloakInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] CloakedTargetTypes = {};
|
public readonly string[] CloakedTargetTypes = {};
|
||||||
public override object Create( ActorInitializer init ) { return new TargetableSubmarine(init.self, this); }
|
public override object Create( ActorInitializer init ) { return new TargetableSubmarine(init.self, this); }
|
||||||
|
|||||||
Reference in New Issue
Block a user