no functional change
This commit is contained in:
Kurt 2022-06-14 00:01:51 -07:00
parent 1a3a365d8a
commit ce935edcdf
6 changed files with 29 additions and 8 deletions

View file

@ -5,7 +5,7 @@ using static PKHeX.Core.LegalityCheckStrings;
namespace PKHeX.Core
{
/// <summary>
/// Verifies the transfer data for a <see cref="PKM"/> that has been irreversably transferred forward.
/// Verifies the transfer data for a <see cref="PKM"/> that has been irreversibly transferred forward.
/// </summary>
public sealed class TransferVerifier : Verifier
{

View file

@ -1,5 +1,8 @@
namespace PKHeX.Core;
/// <summary>
/// Indicates the result of an entity conversion attempt.
/// </summary>
public enum EntityConverterResult
{
None,

View file

@ -1,5 +1,8 @@
namespace PKHeX.Core;
/// <summary>
/// Setting to fill in data (rejuvenate) when converting an entity.
/// </summary>
public enum EntityRejuvenationSetting
{
Custom = -1,

View file

@ -1,14 +1,27 @@
namespace PKHeX.Core;
/// <summary>
/// Interface that exposes a method to <see cref="Rejuvenate"/> data after converting.
/// </summary>
public interface IEntityRejuvenator
{
public void Rejuvenate(PKM result, PKM original);
/// <summary>
/// After converting, the method will attempt to auto-fill missing properties.
/// </summary>
/// <param name="result">Output data after conversion</param>
/// <param name="original">Input data prior to conversion</param>
void Rejuvenate(PKM result, PKM original);
}
/// <summary>
/// Uses <see cref="LegalityAnalysis"/> to auto-fill missing data after conversion.
/// </summary>
public class LegalityRejuvenator : IEntityRejuvenator
{
public void Rejuvenate(PKM result, PKM original)
{
// HOME transfers from PB8/PA8 => PK8 will sanitize Ball & Met/Egg Location.
// Transferring back without a reference PB8/PA8, we need to guess the *original* values.
if (original is not PK8 pk8)
return;
@ -87,8 +100,3 @@ public class LegalityRejuvenator : IEntityRejuvenator
}
}
}
public sealed class EntityRejuvenatorDummy : IEntityRejuvenator
{
public void Rejuvenate(PKM result, PKM original) { }
}

View file

@ -15,6 +15,9 @@
public static string GetName(PKM pk) => Namer.GetName(pk);
}
/// <summary>
/// PKHeX's default <see cref="PKM"/> file naming logic.
/// </summary>
public sealed class DefaultEntityNamer : IFileNamer<PKM>
{
public string GetName(PKM obj)
@ -47,6 +50,10 @@
}
}
/// <summary>
/// Exposes a method to get a file name (no extension) for the type.
/// </summary>
/// <typeparam name="T">Type that the implementer can create a file name for.</typeparam>
public interface IFileNamer<in T>
{
string GetName(T obj);

View file

@ -48,7 +48,7 @@
/// </summary>
/// <param name="level">Current Level</param>
/// <param name="growth">Growth Rate type</param>
/// <returns>Percentage [0,1.00)</returns>
/// <returns>EXP to level up</returns>
public static uint GetEXPToLevelUp(int level, int growth)
{
if (level >= 100)