Minor clean

This commit is contained in:
Kurt
2022-10-01 17:46:11 -07:00
parent 2578ba073c
commit 33a2ab24f1
106 changed files with 268 additions and 313 deletions

View File

@@ -41,7 +41,7 @@ private static EvolutionMethod ReadEvolution(ReadOnlySpan<byte> entry)
Argument = ReadUInt16LittleEndian(entry[2..]),
Species = ReadUInt16LittleEndian(entry[4..]),
Form = SByteToByte((sbyte)entry[6]),
Level = entry[7]
Level = entry[7],
};
}
@@ -55,12 +55,11 @@ public static IReadOnlyList<EvolutionMethod[]> GetArray(BinLinkerAccessor data)
/// <summary>
/// For evo set 7 sbyte is used for form, -1 means no forms are present.
/// The remaining code expects to work with 0 for all base forms.
/// This clamps the sbyte range to 0<>128, removing the negative range.
/// The remaining code expects to work with 0 for all base forms.
/// This clamps the sbyte range to [0-128), removing the negative range.
/// </summary>
private static byte SByteToByte(sbyte b)
{
return (byte)Math.Max(b, (sbyte)0);
}
}