// // SkillUseResponder.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; private readonly Game.Game _game; /// /// Initializes a new instance of the class. /// /// The combat manager. /// The game. public SuResponder(CombatManager combatManager, Game.Game game) { _combatManager = combatManager; _game = game; } /// public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { if (packetArgs.Packet.CasterEntityId == _game.Character?.Id) { _combatManager.CancelSkillTokensAsync(ct); } return Task.FromResult(Result.FromSuccess()); } /// public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) { if (packetArgs.Packet.CasterEntityId == _game.Character?.Id) { _combatManager.CancelSkillTokensAsync(ct); } return Task.FromResult(Result.FromSuccess()); } }