//
// SuResponder.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;
using NosSmooth.Packets.Server.Battle;
using Remora.Results;
namespace NosSmooth.Extensions.Combat.Responders;
///
/// Responds to su packet.
///
public class SuResponder : IPacketResponder, IPacketResponder
{
private readonly CombatManager _combatManager;
///
/// Initializes a new instance of the class.
///
/// The combat manager.
public SuResponder(CombatManager combatManager)
{
_combatManager = combatManager;
}
///
public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default)
{
_combatManager.CancelSkillTokensAsync(ct);
return Task.FromResult(Result.FromSuccess());
}
///
public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default)
{
_combatManager.CancelSkillTokensAsync(ct);
return Task.FromResult(Result.FromSuccess());
}
}