From 5f8a0f3372c87fdb3580e2bbd862b1e8c254d4b9 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 19 Apr 2019 17:01:42 +0000 Subject: [PATCH] Add IBotEnabled interface. --- OpenRA.Mods.Common/Traits/Player/ModularBot.cs | 2 ++ OpenRA.Mods.Common/TraitsInterfaces.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs index 9d07c81119..d073d63181 100644 --- a/OpenRA.Mods.Common/Traits/Player/ModularBot.cs +++ b/OpenRA.Mods.Common/Traits/Player/ModularBot.cs @@ -72,6 +72,8 @@ namespace OpenRA.Mods.Common.Traits player = p; tickModules = p.PlayerActor.TraitsImplementing().ToArray(); attackResponseModules = p.PlayerActor.TraitsImplementing().ToArray(); + foreach (var ibe in p.PlayerActor.TraitsImplementing()) + ibe.BotEnabled(this); } void IBot.QueueOrder(Order order) diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 275db8fb68..409f166e37 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -470,6 +470,9 @@ namespace OpenRA.Mods.Common.Traits [RequireExplicitImplementation] public interface IPreventsShroudReset { bool PreventShroudReset(Actor self); } + [RequireExplicitImplementation] + public interface IBotEnabled { void BotEnabled(IBot bot); } + [RequireExplicitImplementation] public interface IBotTick { void BotTick(IBot bot); }