diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs index a71d1a642f..3590d8c823 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { [Desc("Renders the cargo loaded into the unit.")] - public class WithCargoInfo : ITraitInfo, Requires, Requires + public class WithCargoInfo : ITraitInfo, Requires, Requires { [Desc("Cargo position relative to turret or body in (forward, right, up) triples. The default offset should be in the middle of the list.")] public readonly WVec[] LocalOffset = { WVec.Zero }; @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Cnc.Traits readonly Cargo cargo; readonly IFacing facing; readonly WithCargoInfo cargoInfo; - readonly IBodyOrientation body; + readonly BodyOrientation body; public WithCargo(Actor self, WithCargoInfo info) { @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Cnc.Traits facing = self.TraitOrDefault(); cargoInfo = info; - body = self.Trait(); + body = self.Trait(); } public void Tick(Actor self) diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs index 41a162ac47..544642c3b5 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithGunboatBody.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Cnc.Traits { - class WithGunboatBodyInfo : WithSpriteBodyInfo, Requires, Requires, Requires + class WithGunboatBodyInfo : WithSpriteBodyInfo, Requires, Requires, Requires { [Desc("Turreted 'Turret' key to display")] public readonly string Turret = "primary"; diff --git a/OpenRA.Mods.Common/Effects/Contrail.cs b/OpenRA.Mods.Common/Effects/Contrail.cs index aba9a1d131..8a9c32b495 100644 --- a/OpenRA.Mods.Common/Effects/Contrail.cs +++ b/OpenRA.Mods.Common/Effects/Contrail.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Effects { [Desc("Draw a colored contrail behind this actor when they move.")] - class ContrailInfo : ITraitInfo, Requires + class ContrailInfo : ITraitInfo, Requires { [Desc("Position relative to body")] public readonly WVec Offset = WVec.Zero; @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Effects class Contrail : ITick, IRender { readonly ContrailInfo info; - readonly IBodyOrientation body; + readonly BodyOrientation body; // This is a mutable struct, so it can't be readonly. ContrailRenderable trail; @@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Effects var color = info.UsePlayerColor ? ContrailRenderable.ChooseColor(self) : info.Color; trail = new ContrailRenderable(self.World, color, info.TrailLength, 0, 0); - body = self.Trait(); + body = self.Trait(); } public void Tick(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index d4ba3049f5..1fac6693ea 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits readonly Actor self; Lazy turret; - Lazy coords; + Lazy coords; Lazy ammoPool; List> delayedActions = new List>(); @@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits // We can't resolve these until runtime turret = Exts.Lazy(() => self.TraitsImplementing().FirstOrDefault(t => t.Name == info.Turret)); - coords = Exts.Lazy(() => self.Trait()); + coords = Exts.Lazy(() => self.Trait()); ammoPool = Exts.Lazy(() => self.TraitsImplementing().FirstOrDefault(la => la.Info.Name == info.AmmoPoolName)); Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()]; diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs index c2dcea7fff..ce6d6c0f11 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackGarrisoned.cs @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits public readonly FirePort[] Ports; AttackGarrisonedInfo info; - Lazy coords; + Lazy coords; List armaments; List muzzles; Dictionary paxFacing; @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits : base(self, info) { this.info = info; - coords = Exts.Lazy(() => self.Trait()); + coords = Exts.Lazy(() => self.Trait()); armaments = new List(); muzzles = new List(); paxFacing = new Dictionary(); diff --git a/OpenRA.Mods.Common/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs index b10fdc89a0..8d65700106 100644 --- a/OpenRA.Mods.Common/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public class BodyOrientationInfo : ITraitInfo, IBodyOrientationInfo + public class BodyOrientationInfo : ITraitInfo { [Desc("Number of facings for gameplay calculations. -1 indicates auto-detection from another trait")] public readonly int QuantizedFacings = -1; @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits public object Create(ActorInitializer init) { return new BodyOrientation(init, this); } } - public class BodyOrientation : IBodyOrientation, ISync + public class BodyOrientation : ISync { readonly BodyOrientationInfo info; readonly Lazy quantizedFacings; diff --git a/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs b/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs index 755813525e..d02d943d1d 100644 --- a/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs @@ -27,13 +27,13 @@ namespace OpenRA.Mods.Common.Traits readonly DeveloperMode devMode; Lazy attack; - Lazy coords; + Lazy coords; Lazy health; public CombatDebugOverlay(Actor self) { attack = Exts.Lazy(() => self.TraitOrDefault()); - coords = Exts.Lazy(() => self.Trait()); + coords = Exts.Lazy(() => self.Trait()); health = Exts.Lazy(() => self.TraitOrDefault()); var localPlayer = self.World.LocalPlayer; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs index 6cc787af15..5f436e0602 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderVoxels.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, WRot orientation, int facings, PaletteReference p); } - public class RenderVoxelsInfo : ITraitInfo, IRenderActorPreviewInfo, Requires + public class RenderVoxelsInfo : ITraitInfo, IRenderActorPreviewInfo, Requires { [Desc("Defaults to the actor name.")] public readonly string Image = null; @@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits readonly List components = new List(); readonly Actor self; readonly RenderVoxelsInfo info; - readonly IBodyOrientation body; + readonly BodyOrientation body; readonly WRot camera; readonly WRot lightSource; @@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits { this.self = self; this.info = info; - body = self.Trait(); + body = self.Trait(); camera = new WRot(WAngle.Zero, body.CameraPitch - new WAngle(256), new WAngle(256)); lightSource = new WRot(WAngle.Zero, new WAngle(256) - info.LightPitch, info.LightYaw); } diff --git a/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs index a6168a038f..14e25f0a1d 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits { [Desc("Renders barrels for units with the Turreted trait.")] public class WithBarrelInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires, - Requires, Requires, Requires + Requires, Requires, Requires { [Desc("Sequence name to use.")] [SequenceReference] public readonly string Sequence = "barrel"; @@ -59,13 +59,13 @@ namespace OpenRA.Mods.Common.Traits readonly Actor self; readonly Armament armament; readonly Turreted turreted; - readonly IBodyOrientation body; + readonly BodyOrientation body; public WithBarrel(Actor self, WithBarrelInfo info) : base(info) { this.self = self; - body = self.Trait(); + body = self.Trait(); armament = self.TraitsImplementing() .First(a => a.Info.Name == Info.Armament); turreted = self.TraitsImplementing() diff --git a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs index 3a24d7d4f2..7bbcb1b363 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Rendered when the actor constructed a building.")] - public class WithBuildingPlacedOverlayInfo : ITraitInfo, Requires, Requires + public class WithBuildingPlacedOverlayInfo : ITraitInfo, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "crane-overlay"; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public WithBuildingPlacedOverlay(Actor self, WithBuildingPlacedOverlayInfo info) { var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); buildComplete = !self.HasTrait(); // always render instantly for units diff --git a/OpenRA.Mods.Common/Traits/Render/WithDockingOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithDockingOverlay.cs index 7f9c155bcc..cb0631f846 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDockingOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDockingOverlay.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Rendered when a harvester is docked.")] - public class WithDockingOverlayInfo : ITraitInfo, Requires, Requires + public class WithDockingOverlayInfo : ITraitInfo, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "docking-overlay"; @@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits this.info = info; var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); buildComplete = !self.HasTrait(); // always render instantly for units diff --git a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs index 7f5f9e2dfb..e8e158cdfe 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithFacingSpriteBody.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public class WithFacingSpriteBodyInfo : WithSpriteBodyInfo, Requires, Requires + public class WithFacingSpriteBodyInfo : WithSpriteBodyInfo, Requires, Requires { public override object Create(ActorInitializer init) { return new WithFacingSpriteBody(init, this); } diff --git a/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs index 03e71b21b8..fecdb4bfac 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithHarvestOverlay.cs @@ -15,7 +15,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Displays an overlay whenever resources are harvested by the actor.")] - class WithHarvestOverlayInfo : ITraitInfo, Requires, Requires + class WithHarvestOverlayInfo : ITraitInfo, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "harvest"; @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits { this.info = info; var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); anim = new Animation(self.World, rs.GetImage(self), RenderSprites.MakeFacingFunc(self)); anim.IsDecoration = true; diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs index e1e148a937..2f4a58a107 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Renders a decorative animation on units and buildings.")] - public class WithIdleOverlayInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires + public class WithIdleOverlayInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires { [Desc("Animation to play when the actor is created.")] [SequenceReference] public readonly string StartSequence = null; @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits : base(info) { var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); buildComplete = !self.HasTrait(); // always render instantly for units overlay = new Animation(self.World, rs.GetImage(self)); diff --git a/OpenRA.Mods.Common/Traits/Render/WithParachute.cs b/OpenRA.Mods.Common/Traits/Render/WithParachute.cs index 8a8acfd1d7..2b8c205f32 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithParachute.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithParachute.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Renders a parachute on units.")] - public class WithParachuteInfo : UpgradableTraitInfo, ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires + public class WithParachuteInfo : UpgradableTraitInfo, ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires { [Desc("The image that contains the parachute sequences.")] public readonly string Image = null; @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits // For this, info.Image must not be null var overlay = new Animation(self.World, info.Image); - var body = self.Trait(); + var body = self.Trait(); anim = new AnimationWithOffset(overlay, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), () => IsTraitDisabled && !renderProlonged, diff --git a/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs index a5c6098383..d5b61f8bc0 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithProductionDoorOverlay.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Play an animation when a unit exits or blocks the exit after production finished.")] - class WithProductionDoorOverlayInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires, Requires + class WithProductionDoorOverlayInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires, Requires { public readonly string Sequence = "build-door"; diff --git a/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs index 6000007cbf..26000f049f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithProductionOverlay.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits { [Desc("Renders an animation when the Production trait of the actor is activated.", "Works both with per player ClassicProductionQueue and per building ProductionQueue, but needs any of these.")] - public class WithProductionOverlayInfo : ITraitInfo, Requires, Requires, Requires + public class WithProductionOverlayInfo : ITraitInfo, Requires, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "production-overlay"; @@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits public WithProductionOverlay(Actor self, WithProductionOverlayInfo info) { var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); buildComplete = !self.Info.Traits.Contains(); // always render instantly for units production = self.Info.Traits.Get(); diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs index fccd3e285f..52a4253640 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Displays an overlay when the building is being repaired by the player.")] - public class WithRepairOverlayInfo : ITraitInfo, Requires, Requires + public class WithRepairOverlayInfo : ITraitInfo, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "active"; @@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits public WithRepairOverlay(Actor self, WithRepairOverlayInfo info) { var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); buildComplete = !self.HasTrait(); // always render instantly for units overlay = new Animation(self.World, rs.GetImage(self)); diff --git a/OpenRA.Mods.Common/Traits/Render/WithRotor.cs b/OpenRA.Mods.Common/Traits/Render/WithRotor.cs index 6a7f98693c..281648737a 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRotor.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRotor.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Displays a helicopter rotor overlay.")] - public class WithRotorInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires + public class WithRotorInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires { [Desc("Sequence name to use when flying")] [SequenceReference] public readonly string Sequence = "rotor"; @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits { this.info = info; var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); movement = self.Trait(); rotorAnim = new Animation(self.World, rs.GetImage(self)); diff --git a/OpenRA.Mods.Common/Traits/Render/WithTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs index a522c0b82a..8dc9df6692 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits { [Desc("Renders turrets for units with the Turreted trait.")] public class WithTurretInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, - Requires, Requires, Requires + Requires, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "turret"; @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits public readonly Animation DefaultAnimation; protected readonly AttackBase Attack; readonly RenderSprites rs; - readonly IBodyOrientation body; + readonly BodyOrientation body; readonly Turreted t; readonly Armament[] arms; @@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits : base(info) { rs = self.Trait(); - body = self.Trait(); + body = self.Trait(); Attack = self.TraitOrDefault(); t = self.TraitsImplementing() .First(tt => tt.Name == info.Turret); diff --git a/OpenRA.Mods.Common/Traits/Render/WithTurretedSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithTurretedSpriteBody.cs index 36e7327f67..03c0c1c8e5 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithTurretedSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithTurretedSpriteBody.cs @@ -18,7 +18,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("This actor has turret art with facings baked into the sprite.")] - public class WithTurretedSpriteBodyInfo : WithSpriteBodyInfo, Requires, Requires + public class WithTurretedSpriteBodyInfo : WithSpriteBodyInfo, Requires, Requires { public override object Create(ActorInitializer init) { return new WithTurretedSpriteBody(init, this); } diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs index 87908b7db9..071c1db511 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelBarrel.cs @@ -56,13 +56,13 @@ namespace OpenRA.Mods.Common.Traits readonly Actor self; readonly Armament armament; readonly Turreted turreted; - readonly IBodyOrientation body; + readonly BodyOrientation body; public WithVoxelBarrel(Actor self, WithVoxelBarrelInfo info) : base(info) { this.self = self; - body = self.Trait(); + body = self.Trait(); armament = self.TraitsImplementing() .First(a => a.Info.Name == Info.Armament); turreted = self.TraitsImplementing() diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs index 1d1db6b299..692811dd79 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelBody.cs @@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits public WithVoxelBody(Actor self, WithVoxelBodyInfo info) : base(info) { - var body = self.Trait(); + var body = self.Trait(); var rv = self.Trait(); var voxel = VoxelProvider.GetVoxel(rv.Image, info.Sequence); diff --git a/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs index 45161ff1fb..ea9f9e7617 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithVoxelTurret.cs @@ -49,13 +49,13 @@ namespace OpenRA.Mods.Common.Traits { readonly Actor self; readonly Turreted turreted; - readonly IBodyOrientation body; + readonly BodyOrientation body; public WithVoxelTurret(Actor self, WithVoxelTurretInfo info) : base(info) { this.self = self; - body = self.Trait(); + body = self.Trait(); turreted = self.TraitsImplementing() .First(tt => tt.Name == Info.Turret); diff --git a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs index 26ca8f5d0b..af89a08f65 100644 --- a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs +++ b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class SmokeTrailWhenDamagedInfo : ITraitInfo, Requires + class SmokeTrailWhenDamagedInfo : ITraitInfo, Requires { [Desc("Position relative to body")] public readonly WVec Offset = WVec.Zero; @@ -29,13 +29,13 @@ namespace OpenRA.Mods.Common.Traits class SmokeTrailWhenDamaged : ITick { readonly SmokeTrailWhenDamagedInfo info; - readonly IBodyOrientation body; + readonly BodyOrientation body; int ticks; public SmokeTrailWhenDamaged(Actor self, SmokeTrailWhenDamagedInfo info) { this.info = info; - body = self.Trait(); + body = self.Trait(); } public void Tick(Actor self) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs index bf7663fe86..2cb73d90e6 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class NukePowerInfo : SupportPowerInfo, Requires + class NukePowerInfo : SupportPowerInfo, Requires { [WeaponReference] public readonly string MissileWeapon = ""; @@ -57,12 +57,12 @@ namespace OpenRA.Mods.Common.Traits class NukePower : SupportPower { readonly NukePowerInfo info; - readonly IBodyOrientation body; + readonly BodyOrientation body; public NukePower(Actor self, NukePowerInfo info) : base(self, info) { - body = self.Trait(); + body = self.Trait(); this.info = info; } diff --git a/OpenRA.Mods.Common/Traits/ThrowsParticle.cs b/OpenRA.Mods.Common/Traits/ThrowsParticle.cs index 04a8340c2f..d65991eadd 100644 --- a/OpenRA.Mods.Common/Traits/ThrowsParticle.cs +++ b/OpenRA.Mods.Common/Traits/ThrowsParticle.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class ThrowsParticleInfo : ITraitInfo, Requires, Requires + class ThrowsParticleInfo : ITraitInfo, Requires, Requires { [FieldLoader.Require] public readonly string Anim = null; @@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Traits { var self = init.Self; var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); // TODO: Carry orientation over from the parent instead of just facing var bodyFacing = init.Contains() ? init.Get() : 0; diff --git a/OpenRA.Mods.Common/Traits/Turreted.cs b/OpenRA.Mods.Common/Traits/Turreted.cs index 77cac62ce2..a2c6302265 100644 --- a/OpenRA.Mods.Common/Traits/Turreted.cs +++ b/OpenRA.Mods.Common/Traits/Turreted.cs @@ -13,7 +13,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public class TurretedInfo : ITraitInfo, UsesInit, Requires + public class TurretedInfo : ITraitInfo, UsesInit, Requires { public readonly string Turret = "primary"; [Desc("Rate of Turning")] @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits readonly TurretedInfo info; AttackTurreted attack; IFacing facing; - IBodyOrientation body; + BodyOrientation body; [Sync] public int QuantizedFacings = 0; [Sync] public int TurretFacing = 0; @@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits { attack = self.TraitOrDefault(); facing = self.TraitOrDefault(); - body = self.Trait(); + body = self.Trait(); } public virtual void Tick(Actor self) diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 90de79ea57..a3e912dc0e 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -25,20 +25,6 @@ namespace OpenRA.Mods.Common.Traits void PlayCustomAnimationBackwards(Actor self, string name, Action after); } - public interface IBodyOrientation - { - WAngle CameraPitch { get; } - int QuantizedFacings { get; } - WVec LocalToWorld(WVec vec); - WRot QuantizeOrientation(Actor self, WRot orientation); - } - - public interface IBodyOrientationInfo : ITraitInfo - { - WVec LocalToWorld(WVec vec); - WRot QuantizeOrientation(WRot orientation, int facings); - } - public interface IQuantizeBodyOrientationInfo : ITraitInfo { int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race); diff --git a/OpenRA.Mods.D2k/Traits/Carryall.cs b/OpenRA.Mods.D2k/Traits/Carryall.cs index d256feffd0..c4324a3607 100644 --- a/OpenRA.Mods.D2k/Traits/Carryall.cs +++ b/OpenRA.Mods.D2k/Traits/Carryall.cs @@ -20,7 +20,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { [Desc("Automatically transports harvesters with the Carryable trait between resource fields and refineries.")] - public class CarryallInfo : ITraitInfo, Requires + public class CarryallInfo : ITraitInfo, Requires { [Desc("Set to false when the carryall should not automatically get new jobs.")] public readonly bool Automatic = true; diff --git a/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs index 48cc33babd..017656005c 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.D2k.Traits { [Desc("Rendered when ProductionAirdrop is in progress.")] - public class WithDeliveryOverlayInfo : ITraitInfo, Requires, Requires + public class WithDeliveryOverlayInfo : ITraitInfo, Requires, Requires { [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "active"; @@ -46,7 +46,7 @@ namespace OpenRA.Mods.D2k.Traits this.info = info; var rs = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); // always render instantly for units buildComplete = !self.HasTrait(); diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs index 0c4e8b14b3..e56e89da71 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.TS.Traits public WithVoxelUnloadBody(Actor self, WithVoxelUnloadBodyInfo info) { - var body = self.Trait(); + var body = self.Trait(); var rv = self.Trait(); var idleVoxel = VoxelProvider.GetVoxel(rv.Image, info.IdleSequence); diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs index adb4682911..68415e9127 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.TS.Traits this.info = info; movement = self.Trait(); - var body = self.Trait(); + var body = self.Trait(); var rv = self.Trait(); var voxel = VoxelProvider.GetVoxel(rv.Image, "idle"); diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs index 933e146cb3..bb5893eb18 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelWaterBody.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.TS.Traits { this.self = self; - var body = self.Trait(); + var body = self.Trait(); var rv = self.Trait(); var landVoxel = VoxelProvider.GetVoxel(rv.Image, info.LandSequence);