Implements move execution for battle
This commit is contained in:
@@ -27,7 +27,7 @@ public interface IReadOnlyTypeLibrary
|
||||
/// Gets the effectiveness for a single attacking type against an amount of defending types.
|
||||
/// This is equivalent to running get_single_effectiveness on each defending type, and multiplying the results with each other.
|
||||
/// </summary>
|
||||
float GetEffectiveness(TypeIdentifier attacking, TypeIdentifier[] defending);
|
||||
float GetEffectiveness(TypeIdentifier attacking, IReadOnlyList<TypeIdentifier> defending);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -66,7 +66,7 @@ public class TypeLibrary : IReadOnlyTypeLibrary
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public float GetEffectiveness(TypeIdentifier attacking, TypeIdentifier[] defending) =>
|
||||
public float GetEffectiveness(TypeIdentifier attacking, IReadOnlyList<TypeIdentifier> defending) =>
|
||||
defending.Aggregate<TypeIdentifier, float>(1,
|
||||
(current, type) => current * GetSingleEffectiveness(attacking, type));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user