From 5c85015bc17d327f4b07be03a3495a656f108808 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Wed, 15 Feb 2023 19:46:04 +0100 Subject: [PATCH] feat(core): rename PetWalkCommand to MateWalkCommand, use MateId instead of selector --- .../Walking/{PetWalkCommand.cs => MateWalkCommand.cs} | 6 +++--- Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs | 2 +- Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename Core/NosSmooth.Core/Commands/Walking/{PetWalkCommand.cs => MateWalkCommand.cs} (91%) diff --git a/Core/NosSmooth.Core/Commands/Walking/PetWalkCommand.cs b/Core/NosSmooth.Core/Commands/Walking/MateWalkCommand.cs similarity index 91% rename from Core/NosSmooth.Core/Commands/Walking/PetWalkCommand.cs rename to Core/NosSmooth.Core/Commands/Walking/MateWalkCommand.cs index d2d8a0bc7bc843eb6f7d6c0acfdae57e268f5dc9..de47352a51e4a753ff6608fe863666a915efd590 100644 --- a/Core/NosSmooth.Core/Commands/Walking/PetWalkCommand.cs +++ b/Core/NosSmooth.Core/Commands/Walking/MateWalkCommand.cs @@ -11,16 +11,16 @@ namespace NosSmooth.Core.Commands.Walking; /// /// Walk the given pet to the specified position. /// -/// Index of the pet to move. +/// The id of the mate. /// The target x coordinate. /// The target y coordinate. /// The distance tolerance to the target when to return successful result. /// Whether the command may be cancelled by another task within the same group. /// Whether to wait for finish of the previous task /// Whether to allow the user to cancel by taking any walk/focus/unfollow action -public record PetWalkCommand +public record MateWalkCommand ( - int PetSelector, + long MateId, short TargetX, short TargetY, ushort ReturnDistanceTolerance, diff --git a/Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs b/Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs index 88280186d415f8974075910f8dc153eba2301f11..1df41988f65cdf40f49217cea10fc3b62d3a7e98 100644 --- a/Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs +++ b/Core/NosSmooth.Core/Commands/Walking/WalkCommand.cs @@ -23,8 +23,8 @@ public record WalkCommand ( short TargetX, short TargetY, - IReadOnlyList<(int PetSelector, short TargetX, short TargetY)>? Pets, ushort ReturnDistanceTolerance, + IReadOnlyList<(long MateId, short TargetX, short TargetY)>? Pets = default, bool CanBeCancelledByAnother = true, bool WaitForCancellation = true, bool AllowUserCancel = true diff --git a/Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs b/Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs index b780d2091ee45f39e21f4c58a13d53c948d45e99..4636ffd2c4c31cdd7fd4d78ac05189ed0798894e 100644 --- a/Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs +++ b/Core/NosSmooth.Core/Commands/Walking/WalkCommandHandler.cs @@ -36,7 +36,7 @@ internal class WalkCommandHandler : ICommandHandler public async Task HandleCommand(WalkCommand command, CancellationToken ct = default) { var tasks = new List>(); - foreach (var pet in command.Pets ?? Array.Empty<(int, short, short)>()) + foreach (var pet in command.Pets ?? Array.Empty<(long, short, short)>()) { int x = pet.TargetX; int y = pet.TargetY; @@ -45,9 +45,9 @@ internal class WalkCommandHandler : ICommandHandler ( _nostaleClient.SendCommandAsync ( - new PetWalkCommand + new MateWalkCommand ( - pet.PetSelector, + pet.MateId, (short)x, (short)y, command.ReturnDistanceTolerance,