Implements a bunch more moves

This commit is contained in:
2025-03-08 14:39:50 +01:00
parent 8f262cb4a6
commit 77f1ab243b
33 changed files with 935 additions and 57 deletions

View File

@@ -13,6 +13,11 @@ public interface IReadOnlyTypeLibrary
/// </summary>
bool TryGetTypeIdentifier(StringKey key, out TypeIdentifier typeIdentifier);
/// <summary>
/// Gets the type identifier for a type with an index.
/// </summary>
bool TryGetTypeIdentifierFromIndex(byte index, [MaybeNullWhen(false)] out TypeIdentifier typeIdentifier);
/// <summary>
/// Gets the effectiveness for a single attacking type against a single defending type.
/// </summary>
@@ -46,6 +51,18 @@ public class TypeLibrary : IReadOnlyTypeLibrary
return false;
}
/// <inheritdoc />
public bool TryGetTypeIdentifierFromIndex(byte index, out TypeIdentifier typeIdentifier)
{
if (index < 1 || index > _types.Count)
{
typeIdentifier = default;
return false;
}
typeIdentifier = _types[index - 1];
return true;
}
/// <inheritdoc />
public float GetSingleEffectiveness(TypeIdentifier attacking, TypeIdentifier defending)
{