// // ICombatTechnique.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.Extensions.Combat.Operations; using Remora.Results; namespace NosSmooth.Extensions.Combat.Techniques; /// /// A combat technique that allows to handle the whole combat situations using step callbacks. /// /// /// The callback methods decide the next steps, used in . /// public interface ICombatTechnique { /// /// Should check whether the technique should process more steps or quit the combat. /// /// The combat state. /// Whether to continue with steps. public bool ShouldContinue(ICombatState state); /// /// Handle one step that should enqueue an operation. /// /// /// If error is returned, the combat will be cancelled. /// /// The combat state. /// An id of the current target entity or an error. public Result HandleCombatStep(ICombatState state); /// /// Handles an error from . /// /// /// If an error is returned, the combat will be cancelled. /// /// The combat state. /// The combat operation that returned an error. /// The errorful result. /// A result that may or may not succeed. public Result HandleError(ICombatState state, ICombatOperation operation, Result result); }