Files
9e2c10ef216a1d62c7442421cfd8c5750428fe2d
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;
|
||||
}
|
||||
}
|