Make building and bridge repair traits public
This commit is contained in:
@@ -22,7 +22,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
class BridgeInfo : TraitInfo, IRulesetLoaded, Requires<HealthInfo>, Requires<BuildingInfo>
|
||||
public class BridgeInfo : TraitInfo, IRulesetLoaded, Requires<HealthInfo>, Requires<BuildingInfo>
|
||||
{
|
||||
public readonly bool Long = false;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
class Bridge : IRender, INotifyDamageStateChanged, IRadarSignature
|
||||
public class Bridge : IRender, INotifyDamageStateChanged, IRadarSignature
|
||||
{
|
||||
readonly BuildingInfo buildingInfo;
|
||||
readonly Bridge[] neighbours = new Bridge[2];
|
||||
|
||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Allows bridges to be targeted for demolition and repair.")]
|
||||
class BridgeHutInfo : TraitInfo, IDemolishableInfo
|
||||
public class BridgeHutInfo : TraitInfo, IDemolishableInfo
|
||||
{
|
||||
[Desc("Bridge types to act on")]
|
||||
public readonly string[] Types = { "GroundLevelBridge" };
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new BridgeHut(init.World, this); }
|
||||
}
|
||||
|
||||
class BridgeHut : INotifyCreated, IDemolishable, ITick
|
||||
public class BridgeHut : INotifyCreated, IDemolishable, ITick
|
||||
{
|
||||
public readonly BridgeHutInfo Info;
|
||||
readonly BridgeLayer bridgeLayer;
|
||||
|
||||
@@ -17,14 +17,14 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Allows bridges to be targeted for demolition and repair.")]
|
||||
class LegacyBridgeHutInfo : TraitInfo, IDemolishableInfo
|
||||
public class LegacyBridgeHutInfo : TraitInfo, IDemolishableInfo
|
||||
{
|
||||
public bool IsValidTarget(ActorInfo actorInfo, Actor saboteur) { return false; } // TODO: bridges don't support frozen under fog
|
||||
|
||||
public override object Create(ActorInitializer init) { return new LegacyBridgeHut(init); }
|
||||
}
|
||||
|
||||
class LegacyBridgeHut : IDemolishable
|
||||
public class LegacyBridgeHut : IDemolishable
|
||||
{
|
||||
public Bridge FirstBridge { get; private set; }
|
||||
public Bridge Bridge { get; private set; }
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Can instantly repair other actors, but gets consumed afterwards.")]
|
||||
class EngineerRepairInfo : ConditionalTraitInfo
|
||||
public class EngineerRepairInfo : ConditionalTraitInfo
|
||||
{
|
||||
[Desc("Uses the \"EngineerRepairable\" trait to determine repairability.")]
|
||||
public readonly BitSet<EngineerRepairType> Types = default(BitSet<EngineerRepairType>);
|
||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new EngineerRepair(this); }
|
||||
}
|
||||
|
||||
class EngineerRepair : ConditionalTrait<EngineerRepairInfo>, IIssueOrder, IResolveOrder, IOrderVoice
|
||||
public class EngineerRepair : ConditionalTrait<EngineerRepairInfo>, IIssueOrder, IResolveOrder, IOrderVoice
|
||||
{
|
||||
public EngineerRepair(EngineerRepairInfo info)
|
||||
: base(info) { }
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class EngineerRepairType { }
|
||||
|
||||
[Desc("Eligible for instant repair.")]
|
||||
class EngineerRepairableInfo : ConditionalTraitInfo
|
||||
public class EngineerRepairableInfo : ConditionalTraitInfo
|
||||
{
|
||||
[Desc("Actors with these Types under EngineerRepair trait can repair me.")]
|
||||
public readonly BitSet<EngineerRepairType> Types = default(BitSet<EngineerRepairType>);
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new EngineerRepairable(this); }
|
||||
}
|
||||
|
||||
class EngineerRepairable : ConditionalTrait<EngineerRepairableInfo>
|
||||
public class EngineerRepairable : ConditionalTrait<EngineerRepairableInfo>
|
||||
{
|
||||
public EngineerRepairable(EngineerRepairableInfo info)
|
||||
: base(info) { }
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Can enter a BridgeHut or LegacyBridgeHut to trigger a repair.")]
|
||||
class RepairsBridgesInfo : TraitInfo
|
||||
public class RepairsBridgesInfo : TraitInfo
|
||||
{
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new RepairsBridges(this); }
|
||||
}
|
||||
|
||||
class RepairsBridges : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
public class RepairsBridges : IIssueOrder, IResolveOrder, IOrderVoice
|
||||
{
|
||||
readonly RepairsBridgesInfo info;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[TraitLocation(SystemActors.World)]
|
||||
class LegacyBridgeLayerInfo : TraitInfo
|
||||
public class LegacyBridgeLayerInfo : TraitInfo
|
||||
{
|
||||
[ActorReference]
|
||||
public readonly string[] Bridges = { "bridge1", "bridge2" };
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public override object Create(ActorInitializer init) { return new LegacyBridgeLayer(init.Self, this); }
|
||||
}
|
||||
|
||||
class LegacyBridgeLayer : IWorldLoaded
|
||||
public class LegacyBridgeLayer : IWorldLoaded
|
||||
{
|
||||
readonly LegacyBridgeLayerInfo info;
|
||||
readonly Dictionary<ushort, (string Template, int Health)> bridgeTypes = new Dictionary<ushort, (string, int)>();
|
||||
|
||||
Reference in New Issue
Block a user