Added XML comments where appropriate

This commit is contained in:
evandixon
2016-08-08 16:44:05 -05:00
parent df313c0589
commit fc7f7d788c
2 changed files with 13 additions and 1 deletions

View File

@@ -58,7 +58,14 @@ public static int getPKMDataFormat(byte[] data)
}
return -1;
}
internal static PKM getPKMfromBytes(byte[] data, string ident = null)
/// <summary>
/// Creates an instance of <see cref="PKM"/> from the given data.
/// </summary>
/// <param name="data">Raw data of the Pokemon file.</param>
/// <param name="ident">Optional identifier for the Pokemon. Usually the full path of the source file.</param>
/// <returns>An instance of <see cref="PKM"/> created from the given <paramref name="data"/>, or null if <paramref name="data"/> is invalid.</returns>
public static PKM getPKMfromBytes(byte[] data, string ident = null)
{
checkEncrypted(ref data);
switch (getPKMDataFormat(data))

View File

@@ -25,6 +25,11 @@ public static class PKX
internal const int SIZE_6STORED = 0xE8;
internal const int SIZE_6BLOCK = 56;
/// <summary>
/// Determines if the given length is valid for a Pokemon file.
/// </summary>
/// <param name="len">Length of the data to check.</param>
/// <returns>A boolean indicating whether or not the length is valid for a Pokemon file.</returns>
public static bool getIsPKM(long len)
{
return new[] {SIZE_3STORED, SIZE_3PARTY, SIZE_4STORED, SIZE_4PARTY, SIZE_5PARTY, SIZE_6STORED, SIZE_6PARTY}.Contains((int)len);