// // WalkCommandHandler.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Core.Commands; using NosSmoothCore; using Remora.Results; namespace NosSmooth.LocalClient.CommandHandlers; /// /// Handles . /// public class WalkCommandHandler : ICommandHandler { private readonly NosClient _nosClient; /// /// Initializes a new instance of the class. /// /// The local client. public WalkCommandHandler(NosClient nosClient) { _nosClient = nosClient; } /// public Task HandleCommand(WalkCommand command, CancellationToken ct = default) { _nosClient.GetCharacter().Walk(command.TargetX, command.TargetY); return Task.Delay(1000).ContinueWith(_ => Result.FromSuccess()); // TODO: Wait for the move to finish } }