~ruther/NosSmooth

a0b168d1fd49cf18ca58939d8f1e69c429381497 — Rutherther 3 years ago cb9f277
feat(core): add return distance tolerance to walk commands
M Core/NosSmooth.Core/Commands/Walking/PetWalkCommand.cs => Core/NosSmooth.Core/Commands/Walking/PetWalkCommand.cs +2 -0
@@ 14,6 14,7 @@ namespace NosSmooth.Core.Commands.Walking;
/// <param name="PetSelector">Index of the pet to move.</param>
/// <param name="TargetX">The target x coordinate.</param>
/// <param name="TargetY">The target y coordinate.</param>
/// <param name="ReturnDistanceTolerance">The distance tolerance to the target when to return successful result.</param>
/// <param name="CanBeCancelledByAnother">Whether the command may be cancelled by another task within the same group.</param>
/// <param name="WaitForCancellation">Whether to wait for finish of the previous task</param>
/// <param name="AllowUserCancel">Whether to allow the user to cancel by taking any walk/focus/unfollow action</param>


@@ 22,6 23,7 @@ public record PetWalkCommand
    int PetSelector,
    short TargetX,
    short TargetY,
    ushort ReturnDistanceTolerance,
    bool CanBeCancelledByAnother = true,
    bool WaitForCancellation = true,
    bool AllowUserCancel = true

M Core/NosSmooth.Core/Commands/Walking/PlayerWalkCommand.cs => Core/NosSmooth.Core/Commands/Walking/PlayerWalkCommand.cs +2 -0
@@ 14,6 14,7 @@ namespace NosSmooth.Core.Commands.Walking;
/// </summary>
/// <param name="TargetX">The x coordinate of the target position to move to.</param>
/// <param name="TargetY">The y coordinate of the target position to move to.</param>
/// <param name="ReturnDistanceTolerance">The distance tolerance to the target when to return successful result.</param>
/// <param name="CanBeCancelledByAnother">Whether the command may be cancelled by another task within the same group.</param>
/// <param name="WaitForCancellation">Whether to wait for finish of the previous task</param>
/// <param name="AllowUserCancel">Whether to allow the user to cancel by taking any walk/focus/unfollow action</param>


@@ 21,6 22,7 @@ public record PlayerWalkCommand
(
    short TargetX,
    short TargetY,
    ushort ReturnDistanceTolerance,
    bool CanBeCancelledByAnother = true,
    bool WaitForCancellation = true,
    bool AllowUserCancel = true

M Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs => Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs +2 -0
@@ 14,6 14,7 @@ namespace NosSmooth.Core.Commands.Walking;
/// <param name="TargetX">The target x coordinate.</param>
/// <param name="TargetY">The target y coordinate.</param>
/// <param name="PetSelectors">The pet indices.</param>
/// <param name="ReturnDistanceTolerance">The distance tolerance to the target when to return successful result.</param>
/// <param name="CanBeCancelledByAnother">Whether the command may be cancelled by another task within the same group.</param>
/// <param name="WaitForCancellation">Whether to wait for finish of the previous task</param>
/// <param name="AllowUserCancel">Whether to allow the user to cancel by taking any walk/focus/unfollow action</param>


@@ 22,6 23,7 @@ public record WalkCommand
    short TargetX,
    short TargetY,
    int[] PetSelectors,
    ushort ReturnDistanceTolerance,
    bool CanBeCancelledByAnother = true,
    bool WaitForCancellation = true,
    bool AllowUserCancel = true

M Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs => Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs +2 -0
@@ 65,6 65,7 @@ public class WalkCommandHandler : ICommandHandler<WalkCommand>
                        command.PetSelectors[i],
                        (short)x,
                        (short)y,
                        command.ReturnDistanceTolerance,
                        command.CanBeCancelledByAnother,
                        command.WaitForCancellation,
                        command.AllowUserCancel


@@ 82,6 83,7 @@ public class WalkCommandHandler : ICommandHandler<WalkCommand>
                (
                    command.TargetX,
                    command.TargetY,
                    command.ReturnDistanceTolerance,
                    command.CanBeCancelledByAnother,
                    command.WaitForCancellation,
                    command.AllowUserCancel

Do not follow this link