Add utility AI (#806)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com> Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
25
Content.Server/AI/Utility/UtilityAiHelpers.cs
Normal file
25
Content.Server/AI/Utility/UtilityAiHelpers.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Server.AI.Utility.AiLogic;
|
||||
using Content.Server.AI.WorldState;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.AI.Utility
|
||||
{
|
||||
public static class UtilityAiHelpers
|
||||
{
|
||||
public static Blackboard GetBlackboard(IEntity entity)
|
||||
{
|
||||
if (!entity.TryGetComponent(out AiControllerComponent aiControllerComponent))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (aiControllerComponent.Processor is UtilityAi utilityAi)
|
||||
{
|
||||
return utilityAi.Blackboard;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user