From 72ac5240b8a261f21ee422ddb16a6900dfd833b5 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 20 Dec 2015 18:44:55 +0100 Subject: [PATCH] Remove ISpriteBody --- OpenRA.Mods.Common/Traits/BodyOrientation.cs | 2 +- OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs | 4 ++-- OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs | 4 ++-- OpenRA.Mods.Common/TraitsInterfaces.cs | 8 -------- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BodyOrientation.cs b/OpenRA.Mods.Common/Traits/BodyOrientation.cs index b72253060d..8e9b171ff0 100644 --- a/OpenRA.Mods.Common/Traits/BodyOrientation.cs +++ b/OpenRA.Mods.Common/Traits/BodyOrientation.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits // If a sprite actor has neither custom QuantizedFacings nor a trait implementing IQuantizeBodyOrientationInfo, throw if (qboi == null) { - if (self.Info.HasTraitInfo()) + if (self.Info.HasTraitInfo()) throw new InvalidOperationException("Actor '" + self.Info.Name + "' has a sprite body but no facing quantization." + " Either add the QuantizeFacingsFromSequence trait or set custom QuantizedFacings on BodyOrientation."); else diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs index 5cdb19d28a..6c115ce028 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs @@ -17,7 +17,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Default trait for rendering sprite-based actors.")] - public class WithSpriteBodyInfo : UpgradableTraitInfo, ISpriteBodyInfo, IRenderActorPreviewSpritesInfo, Requires + public class WithSpriteBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires { [Desc("Animation to play when the actor is created."), SequenceReference] public readonly string StartSequence = null; @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits } } - public class WithSpriteBody : UpgradableTrait, ISpriteBody, INotifyDamageStateChanged, INotifyBuildComplete + public class WithSpriteBody : UpgradableTrait, INotifyDamageStateChanged, INotifyBuildComplete { public readonly Animation DefaultAnimation; diff --git a/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs b/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs index 7b3fec2658..75fa0a5474 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/DeployToUpgrade.cs @@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits readonly UpgradeManager manager; readonly bool checkTerrainType; readonly bool canTurn; - readonly Lazy body; + readonly Lazy body; DeployState deployState; @@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits manager = self.Trait(); checkTerrainType = info.AllowedTerrainTypes.Count > 0; canTurn = self.Info.HasTraitInfo(); - body = Exts.Lazy(self.TraitOrDefault); + body = Exts.Lazy(self.TraitOrDefault); if (init.Contains()) deployState = init.Get(); } diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index e3b60646f1..a8b336a8e4 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -19,14 +19,6 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - public interface ISpriteBodyInfo : ITraitInfo { } - public interface ISpriteBody - { - void PlayCustomAnimation(Actor self, string newAnimation, Action after); - void PlayCustomAnimationRepeating(Actor self, string name); - void PlayCustomAnimationBackwards(Actor self, string name, Action after); - } - public interface IQuantizeBodyOrientationInfo : ITraitInfo { int QuantizedBodyFacings(ActorInfo ai, SequenceProvider sequenceProvider, string race);