Refactor AI considerations (#1278)
Considerations are now instantiated under a manager and re-used between entities where they pass in their blackboard to get a score back. Also makes the API a bit nicer to use. Also some random cleanup. Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ using Content.Server.GameObjects.EntitySystems.JobQueues;
|
||||
using Robust.Server.AI;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.AI.Utility.AiLogic
|
||||
@@ -147,6 +148,14 @@ namespace Content.Server.AI.Utility.AiLogic
|
||||
|
||||
private void ReceivedAction()
|
||||
{
|
||||
switch (_actionRequest.Exception)
|
||||
{
|
||||
case null:
|
||||
break;
|
||||
default:
|
||||
Logger.FatalS("ai", _actionRequest.Exception.ToString());
|
||||
throw _actionRequest.Exception;
|
||||
}
|
||||
var action = _actionRequest.Result;
|
||||
_actionRequest = null;
|
||||
// Actions with lower scores should be implicitly dumped by GetAction
|
||||
|
||||
Reference in New Issue
Block a user