6
2026-01-24 12:49:55 +03:00

17 lines
521 B
C#

namespace Content.Server.NPC.HTN.Preconditions;
/// <summary>
/// Checks for the presence of the value by the specified <see cref="KeyExistsPrecondition.Key"/> in the <see cref="NPCBlackboard"/>.
/// Returns true if there is a value.
/// </summary>
public sealed partial class KeyExistsPrecondition : HTNPrecondition
{
[DataField(required: true), ViewVariables]
public string Key = string.Empty;
public override bool IsMet(NPCBlackboard blackboard)
{
return blackboard.ContainsKey(Key);
}
}