* Added new HTN operations & preconditions * Ok I forgot about partial * Namespace pierce the skies * Some fixes, debug and new operators * Bruh git eat my files
18 lines
499 B
C#
18 lines
499 B
C#
namespace Content.Server.NPC.HTN.Preconditions.Math;
|
|
|
|
public sealed partial class KeyFloatLessPrecondition : HTNPrecondition
|
|
{
|
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
|
|
|
[DataField(required: true)]
|
|
public string Key = string.Empty;
|
|
|
|
[DataField(required: true)]
|
|
public float Value;
|
|
|
|
public override bool IsMet(NPCBlackboard blackboard)
|
|
{
|
|
return blackboard.TryGetValue<float>(Key, out var value, _entManager) && value < Value;
|
|
}
|
|
}
|