mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 02:41:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
23 lines
671 B
C#
23 lines
671 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators;
|
|
|
|
public sealed partial class PickRandomRotationOperator : HTNOperator
|
|
{
|
|
[Dependency] private IRobustRandom _random = default!;
|
|
|
|
[DataField("targetKey")]
|
|
public string TargetKey = "RotateTarget";
|
|
|
|
public override async Task<(bool Valid, Dictionary<string, object>? Effects)> Plan(NPCBlackboard blackboard,
|
|
CancellationToken cancelToken)
|
|
{
|
|
var rotation = _random.NextAngle();
|
|
return (true, new Dictionary<string, object>()
|
|
{
|
|
{TargetKey, rotation}
|
|
});
|
|
}
|
|
}
|