Split off last bot modules

And dissolve AI namespace.
There would have been so little left in Common.AI,
that keeping it made no sense anymore.
This commit is contained in:
reaperrr
2018-11-14 15:58:46 +01:00
committed by Paul Chote
parent b74ff33039
commit 54c2894b4e
26 changed files with 1017 additions and 771 deletions

View File

@@ -13,7 +13,6 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.AI;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Traits;
@@ -27,13 +26,13 @@ namespace OpenRA.Mods.Common.Traits.Render
public object Create(ActorInitializer init) { return new RenderDebugState(init.Self, this); }
}
class RenderDebugState : INotifyAddedToWorld, INotifyOwnerChanged, IRenderAboveShroudWhenSelected
class RenderDebugState : INotifyAddedToWorld, INotifyOwnerChanged, INotifyCreated, IRenderAboveShroudWhenSelected
{
readonly DebugVisualizations debugVis;
readonly SpriteFont font;
readonly Actor self;
readonly WVec offset;
readonly HackyAI ai;
SquadManagerBotModule ai;
Color color;
string tagString;
@@ -49,7 +48,11 @@ namespace OpenRA.Mods.Common.Traits.Render
font = Game.Renderer.Fonts[info.Font];
debugVis = self.World.WorldActor.TraitOrDefault<DebugVisualizations>();
ai = self.Owner.PlayerActor.TraitsImplementing<HackyAI>().FirstOrDefault(x => x.IsEnabled);
}
void INotifyCreated.Created(Actor self)
{
ai = self.Owner.PlayerActor.TraitsImplementing<SquadManagerBotModule>().FirstOrDefault(Exts.IsTraitEnabled);
}
void INotifyAddedToWorld.AddedToWorld(Actor self)