M Extensions/NosSmooth.Extensions.Combat/Techniques/ICombatTechnique.cs => Extensions/NosSmooth.Extensions.Combat/Techniques/ICombatTechnique.cs +2 -3
@@ 5,7 5,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using NosSmooth.Extensions.Combat.Operations;
-using OneOf.Types;
using Remora.Results;
namespace NosSmooth.Extensions.Combat.Techniques;
@@ 32,8 31,8 @@ public interface ICombatTechnique
/// If error is returned, the combat will be cancelled.
/// </remarks>
/// <param name="state">The combat state.</param>
- /// <returns>A result that may or may not succeed.</returns>
- public Result HandleCombatStep(ICombatState state);
+ /// <returns>An id of the current target entity or an error.</returns>
+ public Result<long?> HandleCombatStep(ICombatState state);
/// <summary>
/// Handles an error from <see cref="ICombatOperation.UseAsync"/>.
M Extensions/NosSmooth.Extensions.Combat/Techniques/SimpleAttackTechnique.cs => Extensions/NosSmooth.Extensions.Combat/Techniques/SimpleAttackTechnique.cs +4 -4
@@ 63,7 63,7 @@ public class SimpleAttackTechnique : ICombatTechnique
}
/// <inheritdoc />
- public Result HandleCombatStep(ICombatState state)
+ public Result<long?> HandleCombatStep(ICombatState state)
{
var map = state.Game.CurrentMap;
if (map is null)
@@ 106,10 106,10 @@ public class SimpleAttackTechnique : ICombatTechnique
{
if (skillResult.Error is SkillNotFoundError)
{
- return Result.FromSuccess();
+ return _target.Id;
}
- return Result.FromError(skillResult);
+ return Result<long?>.FromError(skillResult);
}
_currentSkill = skillResult.Entity;
@@ 141,7 141,7 @@ public class SimpleAttackTechnique : ICombatTechnique
state.UseSkill(_currentSkill, _target);
}
- return Result.FromSuccess();
+ return _target.Id;
}
/// <inheritdoc />