Include (stub) string validation in Gen 5

This commit is contained in:
Megan Edwards 2024-11-13 22:23:25 -05:00
parent 7d7ce9d360
commit 2f2dfc8866
2 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using PkmnFoundations.Pokedex;
using PkmnFoundations.Support;
using PkmnFoundations.Wfc;
namespace PkmnFoundations.Structures
{
@ -354,6 +355,18 @@ namespace PkmnFoundations.Structures
if (move.MoveID > 559) return new ValidationSummary() { IsValid = false };
}
if (thePokemon is Pokemon5)
{
var thePokemon5 = (Pokemon5)thePokemon;
if (!thePokemon5.NicknameEncoded.IsValid) return new ValidationSummary() { IsValid = false };
if (!thePokemon5.TrainerNameEncoded.IsValid) return new ValidationSummary() { IsValid = false };
}
else if (thePokemon is BattleSubwayPokemon5)
{
var theBattleSubwayPokemon5 = (BattleSubwayPokemon5)thePokemon;
if (!theBattleSubwayPokemon5.NicknameEncoded.IsValid) return new ValidationSummary() { IsValid = false };
}
return new ValidationSummary() { IsValid = true };
}
}

View File

@ -203,6 +203,8 @@ namespace PkmnFoundations.Wfc
{
if (!base.Validate()) return false;
if (!TrainerNameEncoded.IsValid) return false;
return true;
}