// // WalkResponder.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.Packets; using NosSmooth.Packets.Client.Movement; using Remora.Results; namespace NosSmooth.Extensions.Pathfinding.Responders; /// internal class WalkResponder : IPacketResponder { private readonly PathfinderState _state; /// /// Initializes a new instance of the class. /// /// The state. public WalkResponder(PathfinderState state) { _state = state; } /// public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { var packet = packetArgs.Packet; _state.X = packet.PositionX; _state.Y = packet.PositionY; return Task.FromResult(Result.FromSuccess()); } }