//
// ControlCommandPacketResponders.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 System.Threading;
using System.Threading.Tasks;
using NosSmooth.Core.Commands.Walking;
using NosSmooth.Core.Packets;
using NosSmooth.Packets.Client.Movement;
using NosSmooth.Packets.Server.Maps;
using Remora.Results;
namespace NosSmooth.Core.Commands.Control;
///
/// Packet responder for cancellation of .
///
public class ControlCommandPacketResponders : IPacketResponder
{
private readonly ControlCommands _controlCommands;
///
/// Initializes a new instance of the class.
///
/// The control commands.
public ControlCommandPacketResponders(ControlCommands controlCommands)
{
_controlCommands = controlCommands;
}
///
public Task Respond(PacketEventArgs packet, CancellationToken ct = default)
{
return _controlCommands.CancelAsync(ControlCommandsFilter.MapChangeCancellable);
}
}