Add xmldoc

This commit is contained in:
Kurt
2018-07-20 20:22:46 -07:00
parent c9abeda508
commit 4b0a2d90b9
9 changed files with 121 additions and 6 deletions

View File

@@ -13,18 +13,49 @@ namespace PKHeX.Core
public partial class LegalityAnalysis
{
internal readonly PKM pkm;
internal readonly PersonalInfo PersonalInfo;
private readonly bool Error;
private readonly List<CheckResult> Parse = new List<CheckResult>();
private IEncounterable EncounterOriginalGB;
/// <summary>
/// Matched encounter data for the <see cref="pkm"/>.
/// </summary>
public IEncounterable EncounterMatch => Info.EncounterMatch;
/// <summary>
/// Original encounter data for the <see cref="pkm"/>.
/// </summary>
/// <remarks>
/// Generation 1/2 <see cref="pkm"/> that are transferred forward to Generation 7 are restricted to new encounter details.
/// By retaining their original match, more information can be provided by the parse.
/// </remarks>
public IEncounterable EncounterOriginal => EncounterOriginalGB ?? EncounterMatch;
/// <summary>
/// Indicates if all checks ran to completion.
/// </summary>
/// <remarks>This value is false if any checks encountered an error.</remarks>
public readonly bool Parsed;
/// <summary>
/// Indicates if all checks returned a <see cref="Severity.Valid"/> result.
/// </summary>
public readonly bool Valid;
public readonly PersonalInfo PersonalInfo;
/// <summary>
/// Contains various data reused for multiple checks.
/// </summary>
public LegalInfo Info { get; private set; }
/// <summary>
/// Creates a report message with optional verbosity for in-depth analysis.
/// </summary>
/// <param name="verbose">Include all details in the parse, including valid check messages.</param>
/// <returns>Single line string</returns>
public string Report(bool verbose = false) => verbose ? GetVerboseLegalityReport() : GetLegalityReport();
private IEnumerable<int> AllSuggestedMoves
{
get
@@ -177,8 +208,18 @@ private void ParsePK7()
UpdateChecks();
}
public void AddLine(Severity s, string c, CheckIdentifier i) => AddLine(new CheckResult(s, c, i));
public void AddLine(CheckResult chk) => Parse.Add(chk);
/// <summary>
/// Adds a new Check parse value.
/// </summary>
/// <param name="s">Check severity</param>
/// <param name="c">Check comment</param>
/// <param name="i">Check type</param>
internal void AddLine(Severity s, string c, CheckIdentifier i) => AddLine(new CheckResult(s, c, i));
/// <summary>
/// Adds a new Check parse value.
/// </summary>
internal void AddLine(CheckResult chk) => Parse.Add(chk);
private void UpdateVCTransferInfo()
{
@@ -337,7 +378,9 @@ private string GetVerboseLegalityReport()
return GetLegalityReport() + string.Join(Environment.NewLine, lines);
}
// Suggestions
/// <summary>
/// Gets the current <see cref="PKM.RelearnMoves"/> array of four moves that might be legal.
/// </summary>
public int[] GetSuggestedRelearn()
{
if (Info?.RelearnBase == null || Info.Generation < 6)
@@ -355,6 +398,13 @@ public int[] GetSuggestedRelearn()
window.CopyTo(start, moves, 0, count);
return moves;
}
/// <summary>
/// Gets four moves which can be learned depending on the input arguments.
/// </summary>
/// <param name="tm">Allow TM moves</param>
/// <param name="tutor">Allow Tutor moves</param>
/// <param name="reminder">Allow Move Reminder</param>
public int[] GetSuggestedMoves(bool tm, bool tutor, bool reminder)
{
if (!Parsed)
@@ -370,6 +420,10 @@ public int[] GetSuggestedMoves(bool tm, bool tutor, bool reminder)
var evos = Info.EvoChainsAllGens;
return Legal.GetValidMoves(pkm, evos, Tutor: tutor, Machine: tm, MoveReminder: reminder).Skip(1).ToArray(); // skip move 0
}
/// <summary>
/// Gets an object containing met data properties that might be legal.
/// </summary>
public EncounterStatic GetSuggestedMetInfo() => EncounterSuggestion.GetSuggestedMetInfo(pkm);
}
}

View File

@@ -10,11 +10,25 @@ namespace PKHeX.Core
/// </remarks>
public enum Severity
{
/// <summary>
/// Cannot determine validity; not valid.
/// </summary>
Indeterminate = -2,
/// <summary>
/// Definitively not valid.
/// </summary>
Invalid = -1,
/// <summary>
/// Suspicious values, but still valid.
/// </summary>
Fishy = 0,
/// <summary>
/// Values are valid.
/// </summary>
Valid = 1,
NotImplemented = 2,
}
public static partial class Extensions

View File

@@ -6,9 +6,24 @@
/// <remarks>Used for only Generation 1/2 data.</remarks>
public enum TradebackType
{
/// <summary>
/// Information can originate from either generation without restrictions.
/// </summary>
Any,
/// <summary>
/// Information can only originate from Gen1.
/// </summary>
Gen1_NotTradeback,
/// <summary>
/// Information can only originate from Gen2.
/// </summary>
Gen2_NotTradeback,
/// <summary>
/// Information can only exist if has visited both Gen1 and Gen2.
/// </summary>
WasTradeback
}
}

View File

@@ -3,10 +3,24 @@
namespace PKHeX.Core
{
/// <summary>
/// Levelup Learn Movepool Information
/// </summary>
public abstract class Learnset
{
/// <summary>
/// Amount of moves present.
/// </summary>
protected int Count;
/// <summary>
/// Moves that can be learned.
/// </summary>
protected int[] Moves;
/// <summary>
/// Levels at which a move at a given index can be learned.
/// </summary>
protected int[] Levels;
/// <summary>

View File

@@ -2,6 +2,9 @@
namespace PKHeX.Core
{
/// <summary>
/// Levelup Learn Movepool Information
/// </summary>
public sealed class Learnset1 : Learnset
{
private Learnset1(byte[] data, ref int offset)

View File

@@ -2,6 +2,9 @@
namespace PKHeX.Core
{
/// <summary>
/// Levelup Learn Movepool Information
/// </summary>
public sealed class Learnset6 : Learnset
{
private Learnset6(byte[] data)

View File

@@ -1,5 +1,8 @@
namespace PKHeX.Core
{
/// <summary>
/// Legality Check Parse object containing information about a single ribbon.
/// </summary>
internal class RibbonResult
{
/// <summary>Ribbon Display Name</summary>
@@ -15,6 +18,9 @@ public RibbonResult(string prop, bool invalid = true)
Invalid = invalid;
}
/// <summary>
/// Merges the result name with another provided result.
/// </summary>
public void Combine(RibbonResult other)
{
Name += $" / {other.Name}";

View File

@@ -2,6 +2,9 @@
namespace PKHeX.Core
{
/// <summary>
/// String Translation Utility
/// </summary>
public static class RibbonStrings
{
private static readonly Dictionary<string, string> RibbonNames = new Dictionary<string, string>();

View File

@@ -5,7 +5,10 @@
namespace PKHeX.Core
{
internal class RibbonVerifier : Verifier
/// <summary>
/// Verifies the <see cref="PKM"/> Ribbon values.
/// </summary>
public sealed class RibbonVerifier : Verifier
{
protected override CheckIdentifier Identifier => CheckIdentifier.Ribbon;
public override void Verify(LegalityAnalysis data)