Remove FluentResults, documentation
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Immutable;
|
||||
using FluentResults;
|
||||
using PkmnLib.Static.Utils;
|
||||
using PkmnLib.Static.Utils.Errors;
|
||||
|
||||
@@ -59,7 +58,7 @@ public interface IForm : INamedValue
|
||||
/// <summary>
|
||||
/// Get a type of the form at a certain index.
|
||||
/// </summary>
|
||||
Result<TypeIdentifier> GetType(int index);
|
||||
TypeIdentifier GetType(int index);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single base stat value.
|
||||
@@ -74,7 +73,7 @@ public interface IForm : INamedValue
|
||||
/// <summary>
|
||||
/// Gets an ability from the form.
|
||||
/// </summary>
|
||||
Result<StringKey> GetAbility(AbilityIndex index);
|
||||
StringKey GetAbility(AbilityIndex index);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a random ability from the form.
|
||||
@@ -150,10 +149,10 @@ public class FormImpl : IForm
|
||||
public ImmutableHashSet<StringKey> Flags { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Result<TypeIdentifier> GetType(int index)
|
||||
public TypeIdentifier GetType(int index)
|
||||
{
|
||||
if (index < 0 || index >= Types.Count)
|
||||
return Result.Fail(new OutOfRange("Type", index, Types.Count));
|
||||
throw new OutOfRangeException("Type", index, Types.Count);
|
||||
return Types[index];
|
||||
}
|
||||
|
||||
@@ -185,11 +184,11 @@ public class FormImpl : IForm
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Result<StringKey> GetAbility(AbilityIndex index)
|
||||
public StringKey GetAbility(AbilityIndex index)
|
||||
{
|
||||
var array = index.IsHidden ? HiddenAbilities : Abilities;
|
||||
if (index.Index >= array.Count)
|
||||
return Result.Fail(new OutOfRange("Ability", index.Index, array.Count));
|
||||
throw new OutOfRangeException("Ability", index.Index, array.Count);
|
||||
return array[index.Index];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user