From cb9f2774a9ec260248a49e02d5b0c32388e900b3 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 13 Feb 2022 19:04:52 +0100 Subject: [PATCH] feat(core): add attack command --- .../Commands/Attack/AttackCommand.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Core/NosSmooth.Core/Commands/Attack/AttackCommand.cs diff --git a/Core/NosSmooth.Core/Commands/Attack/AttackCommand.cs b/Core/NosSmooth.Core/Commands/Attack/AttackCommand.cs new file mode 100644 index 0000000..7e9e1bc --- /dev/null +++ b/Core/NosSmooth.Core/Commands/Attack/AttackCommand.cs @@ -0,0 +1,34 @@ +// +// AttackCommand.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; +using System.Threading; +using System.Threading.Tasks; +using NosSmooth.Core.Commands.Control; +using Remora.Results; + +namespace NosSmooth.Core.Commands.Attack; + +/// +/// A take control command used to take control of attacking at a given target. +/// +/// The id of the target the bot will be attacking. +/// The callback to be called when the control has been gained. +/// Whether the command may be cancelled by another task within the same group. +/// Whether to wait for finish of the previous task +/// Whether to allow the user to cancel by taking any walk/focus/unfollow action +public record AttackCommand +( + long? TargetId, + Func> HandleAttackCallback, + bool CanBeCancelledByAnother = true, + bool WaitForCancellation = true, + bool AllowUserCancel = true +) : ITakeControlCommand +{ + /// + public bool CancelOnMapChange => true; +} \ No newline at end of file -- 2.49.0