From d7c2c6afc42caf1eb15f7c3138c405048772be2f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 27 Sep 2017 21:49:22 +0200 Subject: [PATCH] Require explicit INotifySelected and INotifySelection --- OpenRA.Game/Traits/TraitsInterfaces.cs | 3 +++ OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 1eee307eb2..967caafb8f 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -301,8 +301,11 @@ namespace OpenRA.Traits [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:InterfaceNamesMustBeginWithI", Justification = "Not a real interface, but more like a tag.")] public interface UsesInit : ITraitInfo where T : IActorInit { } + [RequireExplicitImplementation] public interface INotifySelected { void Selected(Actor self); } + [RequireExplicitImplementation] public interface INotifySelection { void SelectionChanged(); } + public interface IWorldLoaded { void WorldLoaded(World w, WorldRenderer wr); } public interface ICreatePlayers { void CreatePlayers(World w); } diff --git a/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs b/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs index 61944c5ee8..e2ba0430b1 100644 --- a/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs +++ b/OpenRA.Mods.Common/Traits/ProductionQueueFromSelection.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits paletteWidget = Exts.Lazy(() => Ui.Root.GetOrNull(info.ProductionPaletteWidget) as ProductionPaletteWidget); } - public void SelectionChanged() + void INotifySelection.SelectionChanged() { // Disable for spectators if (world.LocalPlayer == null)