mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
Add xmldoc
This commit is contained in:
parent
9bddc89c07
commit
b96e2cacd7
14 changed files with 63 additions and 24 deletions
|
@ -1,5 +1,8 @@
|
|||
namespace PKHeX.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates or coerces values pertaining to <see cref="Species.Wurmple"/> and its branched evolutions.
|
||||
/// </summary>
|
||||
public static class WurmpleUtil
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -33,15 +33,15 @@ public static class StringConverter
|
|||
/// <summary>
|
||||
/// Gets the bytes for a Generation specific string according to the input parameters.
|
||||
/// </summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <param name="generation">Generation string format</param>
|
||||
/// <param name="jp">Encoding is Japanese</param>
|
||||
/// <param name="isBigEndian">Encoding is Big Endian</param>
|
||||
/// <param name="language">Language specific conversion (Chinese)</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
/// <returns>Count of bytes written to the <see cref="destBuffer"/>.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength, StringConverterOption option,
|
||||
int generation, bool jp, bool isBigEndian, int language = 0) => generation switch
|
||||
{
|
||||
|
|
|
@ -127,11 +127,11 @@ public static class StringConverter12
|
|||
/// <summary>
|
||||
/// Converts a string to Generation 1 encoded data.
|
||||
/// </summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="jp">Data destination is Japanese.</param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength, bool jp,
|
||||
StringConverterOption option = StringConverterOption.Clear50)
|
||||
|
|
|
@ -66,9 +66,9 @@ public static class StringConverter2KOR
|
|||
/// Converts a string to Generation 1 encoded data.
|
||||
/// </summary>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(ReadOnlySpan<char> value, Span<byte> destBuffer, int maxLength, StringConverterOption option = StringConverterOption.Clear50)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ public static class StringConverter3
|
|||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="jp">String destination is Japanese font.</param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> buffer, ReadOnlySpan<char> value, int maxLength, bool jp,
|
||||
StringConverterOption option = StringConverterOption.ClearFF)
|
||||
|
|
|
@ -3,6 +3,9 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 3 GameCube games.
|
||||
/// </summary>
|
||||
public static class StringConverter3GC
|
||||
{
|
||||
private const char TerminatorBigEndian = (char)0; // GC
|
||||
|
@ -31,7 +34,7 @@ public static class StringConverter3GC
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a Big Endian string.</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option">Option to clear the buffer. Only <see cref="StringConverterOption.ClearZero"/> is recognized.</param>
|
||||
|
|
|
@ -40,10 +40,10 @@ public static class StringConverter4
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a 4th Generation String</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength,
|
||||
StringConverterOption option = StringConverterOption.ClearZero)
|
||||
|
|
|
@ -4,6 +4,9 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 4 GameCube games.
|
||||
/// </summary>
|
||||
public static class StringConverter4GC
|
||||
{
|
||||
private const ushort Terminator = 0xFFFF;
|
||||
|
@ -41,10 +44,10 @@ public static class StringConverter4GC
|
|||
/// <summary>
|
||||
/// Converts a string to Generation 4 Big Endian encoded character data.
|
||||
/// </summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">String to be converted.</param>
|
||||
/// <param name="maxLength">Maximum length of string</param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Byte array containing encoded character data</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength,
|
||||
StringConverterOption option = StringConverterOption.ClearZero)
|
||||
|
@ -102,9 +105,9 @@ public static class StringConverter4GC
|
|||
/// </summary>
|
||||
/// <remarks>Used by the Save File's internal strings.</remarks>
|
||||
/// <param name="value">String to be converted.</param>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="maxLength">Maximum length of string</param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Byte array containing encoded character data</returns>
|
||||
public static int SetStringUnicode(ReadOnlySpan<char> value, Span<byte> destBuffer, int maxLength, StringConverterOption option = StringConverterOption.ClearZero)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,9 @@ using System.Linq;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Utility Logic for converting Generation 4 character encoding.
|
||||
/// </summary>
|
||||
public static class StringConverter4Util
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -3,6 +3,9 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 5 games.
|
||||
/// </summary>
|
||||
public static class StringConverter5
|
||||
{
|
||||
private const char TerminatorFFFF = (char)0xFFFF;
|
||||
|
@ -31,10 +34,10 @@ public static class StringConverter5
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a Generation 5 string.</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength,
|
||||
StringConverterOption option = StringConverterOption.ClearZero)
|
||||
|
|
|
@ -3,6 +3,10 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 6 games.
|
||||
/// </summary>
|
||||
/// <remarks>Customized Unicode glyph remapping for visual display</remarks>
|
||||
public static class StringConverter6
|
||||
{
|
||||
private const ushort TerminatorNull = 0;
|
||||
|
@ -31,10 +35,10 @@ public static class StringConverter6
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a Generation 6 string.</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength,
|
||||
StringConverterOption option = StringConverterOption.ClearZero)
|
||||
|
|
|
@ -3,6 +3,10 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 7 games.
|
||||
/// </summary>
|
||||
/// <remarks>Customized Unicode glyph remapping for visual display. Chinese Species names use a special range of characters -- <see cref="StringConverter7ZH"/>.</remarks>
|
||||
public static class StringConverter7
|
||||
{
|
||||
private const ushort TerminatorNull = 0;
|
||||
|
@ -34,11 +38,11 @@ public static class StringConverter7
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a Generation 7 string.</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="language">Language specific conversion (Chinese)</param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <param name="chinese">Chinese string remapping should be attempted</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength, int language,
|
||||
|
|
|
@ -3,6 +3,10 @@ using static System.Buffers.Binary.BinaryPrimitives;
|
|||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Logic for converting a <see cref="string"/> for Generation 8 games.
|
||||
/// </summary>
|
||||
/// <remarks>Also used by LGP/E; this encoding is essentially the same as Generation 6's.</remarks>
|
||||
public static class StringConverter8
|
||||
{
|
||||
private const ushort TerminatorNull = 0;
|
||||
|
@ -31,10 +35,10 @@ public static class StringConverter8
|
|||
}
|
||||
|
||||
/// <summary>Gets the bytes for a Generation 7-Beluga string.</summary>
|
||||
/// <param name="destBuffer"></param>
|
||||
/// <param name="destBuffer">Span of bytes to write encoded string data</param>
|
||||
/// <param name="value">Decoded string.</param>
|
||||
/// <param name="maxLength">Maximum length of the input <see cref="value"/></param>
|
||||
/// <param name="option"></param>
|
||||
/// <param name="option">Buffer pre-formatting option</param>
|
||||
/// <returns>Encoded data.</returns>
|
||||
public static int SetString(Span<byte> destBuffer, ReadOnlySpan<char> value, int maxLength,
|
||||
StringConverterOption option = StringConverterOption.ClearZero)
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
namespace PKHeX.Core;
|
||||
|
||||
/// <summary>
|
||||
/// String Buffer pre-formatting option
|
||||
/// </summary>
|
||||
public enum StringConverterOption
|
||||
{
|
||||
/// <summary> Does not do any operation on the buffer. </summary>
|
||||
None,
|
||||
|
||||
/// <summary> Zeroes out the entire buffer. </summary>
|
||||
ClearZero,
|
||||
|
||||
/// <summary> Fills the entire buffer with 0x50; used by Generation 1/2 string encoding. </summary>
|
||||
Clear50,
|
||||
|
||||
/// <summary> Fills the entire buffer with 0x7F; used by Generation 1/2 Stadium to space over for the next line. </summary>
|
||||
Clear7F,
|
||||
|
||||
/// <summary> Fills the entire buffer with 0xFF; used by Generation 3-5 which use 0xFF/0xFFFF as their terminator. </summary>
|
||||
ClearFF,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue