2024-05-08 19:18:03 +10:00
|
|
|
namespace Content.Server.NPC.HTN.Preconditions;
|
|
|
|
|
|
2024-06-02 03:46:35 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if there is no value at the specified <see cref="KeyNotExistsPrecondition.Key"/> in the <see cref="NPCBlackboard"/>.
|
|
|
|
|
/// Returns true if there is no value.
|
|
|
|
|
/// </summary>
|
2024-05-08 19:18:03 +10:00
|
|
|
public sealed partial class KeyNotExistsPrecondition : HTNPrecondition
|
|
|
|
|
{
|
2024-06-02 03:46:35 +10:00
|
|
|
[DataField(required: true), ViewVariables]
|
2024-05-08 19:18:03 +10:00
|
|
|
public string Key = string.Empty;
|
|
|
|
|
|
|
|
|
|
public override bool IsMet(NPCBlackboard blackboard)
|
|
|
|
|
{
|
|
|
|
|
return !blackboard.ContainsKey(Key);
|
|
|
|
|
}
|
|
|
|
|
}
|