Clean up new HTNs tasks (#28469)
* Clean up new HTNs tasks * Added docs to math operations
This commit is contained in:
@@ -4,13 +4,14 @@ using System.Threading.Tasks;
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Math;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key, and adds the value to that float
|
||||
/// Added <see cref="AddFloatOperator.Amount"/> to float value for the
|
||||
/// specified <see cref="AddFloatOperator.TargetKey"/> in the <see cref="NPCBlackboard"/>.
|
||||
/// </summary>
|
||||
public sealed partial class AddFloatOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
[DataField(required: true)]
|
||||
[DataField(required: true), ViewVariables]
|
||||
public string TargetKey = string.Empty;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -4,11 +4,12 @@ using System.Threading.Tasks;
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Math;
|
||||
|
||||
/// <summary>
|
||||
/// Just sets a blackboard key to a bool
|
||||
/// Set <see cref="SetBoolOperator.Value"/> to bool value for the
|
||||
/// specified <see cref="SetFloatOperator.TargetKey"/> in the <see cref="NPCBlackboard"/>.
|
||||
/// </summary>
|
||||
public sealed partial class SetBoolOperator : HTNOperator
|
||||
{
|
||||
[DataField(required: true)]
|
||||
[DataField(required: true), ViewVariables]
|
||||
public string TargetKey = string.Empty;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -4,11 +4,12 @@ using System.Threading.Tasks;
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Math;
|
||||
|
||||
/// <summary>
|
||||
/// Just sets a blackboard key to a float
|
||||
/// Set <see cref="SetFloatOperator.Amount"/> to float value for the
|
||||
/// specified <see cref="SetFloatOperator.TargetKey"/> in the <see cref="NPCBlackboard"/>.
|
||||
/// </summary>
|
||||
public sealed partial class SetFloatOperator : HTNOperator
|
||||
{
|
||||
[DataField(required: true)]
|
||||
[DataField(required: true), ViewVariables]
|
||||
public string TargetKey = string.Empty;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -5,20 +5,22 @@ using Robust.Shared.Random;
|
||||
namespace Content.Server.NPC.HTN.PrimitiveTasks.Operators.Math;
|
||||
|
||||
/// <summary>
|
||||
/// Sets a random float from MinAmount to MaxAmount to blackboard
|
||||
/// Set random float value between <see cref="SetRandomFloatOperator.MinAmount"/> and
|
||||
/// <see cref="SetRandomFloatOperator.MaxAmount"/> specified <see cref="SetRandomFloatOperator.TargetKey"/>
|
||||
/// in the <see cref="NPCBlackboard"/>.
|
||||
/// </summary>
|
||||
public sealed partial class SetRandomFloatOperator : HTNOperator
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
|
||||
[DataField(required: true)]
|
||||
[DataField(required: true), ViewVariables]
|
||||
public string TargetKey = string.Empty;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxAmount = 1f;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinAmount = 0f;
|
||||
public float MinAmount;
|
||||
|
||||
public override async Task<(bool Valid, Dictionary<string, object>? Effects)> Plan(NPCBlackboard blackboard,
|
||||
CancellationToken cancelToken)
|
||||
|
||||
Reference in New Issue
Block a user