Require explicit INotifySelected and INotifySelection

This commit is contained in:
reaperrr
2017-09-27 21:49:22 +02:00
committed by abcdefg30
parent a8e6cd2604
commit d7c2c6afc4
2 changed files with 4 additions and 1 deletions

View File

@@ -301,8 +301,11 @@ namespace OpenRA.Traits
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:InterfaceNamesMustBeginWithI", Justification = "Not a real interface, but more like a tag.")] [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:InterfaceNamesMustBeginWithI", Justification = "Not a real interface, but more like a tag.")]
public interface UsesInit<T> : ITraitInfo where T : IActorInit { } public interface UsesInit<T> : ITraitInfo where T : IActorInit { }
[RequireExplicitImplementation]
public interface INotifySelected { void Selected(Actor self); } public interface INotifySelected { void Selected(Actor self); }
[RequireExplicitImplementation]
public interface INotifySelection { void SelectionChanged(); } public interface INotifySelection { void SelectionChanged(); }
public interface IWorldLoaded { void WorldLoaded(World w, WorldRenderer wr); } public interface IWorldLoaded { void WorldLoaded(World w, WorldRenderer wr); }
public interface ICreatePlayers { void CreatePlayers(World w); } public interface ICreatePlayers { void CreatePlayers(World w); }

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
paletteWidget = Exts.Lazy(() => Ui.Root.GetOrNull(info.ProductionPaletteWidget) as ProductionPaletteWidget); paletteWidget = Exts.Lazy(() => Ui.Root.GetOrNull(info.ProductionPaletteWidget) as ProductionPaletteWidget);
} }
public void SelectionChanged() void INotifySelection.SelectionChanged()
{ {
// Disable for spectators // Disable for spectators
if (world.LocalPlayer == null) if (world.LocalPlayer == null)