2021-06-08 03:02:57 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using static PKHeX.Core.MessageStrings;
|
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Utility for editing a <see cref="PKM"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class EntitySuggestionUtil
|
2021-06-08 03:02:57 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public static List<string> GetMetLocationSuggestionMessage(PKM pk, int level, int location, int minimumLevel)
|
2021-06-08 03:02:57 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var suggestion = new List<string> { MsgPKMSuggestionStart };
|
|
|
|
|
if (pk.Format >= 3)
|
2021-06-08 03:02:57 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
var metList = GameInfo.GetLocationList((GameVersion)pk.Version, pk.Context, egg: false);
|
|
|
|
|
var locationName = metList.First(loc => loc.Value == location).Text;
|
|
|
|
|
suggestion.Add($"{MsgPKMSuggestionMetLocation} {locationName}");
|
|
|
|
|
suggestion.Add($"{MsgPKMSuggestionMetLevel} {level}");
|
2021-06-08 03:02:57 +00:00
|
|
|
|
}
|
2022-06-18 18:04:24 +00:00
|
|
|
|
if (pk.CurrentLevel < minimumLevel)
|
|
|
|
|
suggestion.Add($"{MsgPKMSuggestionLevel} {minimumLevel}");
|
|
|
|
|
return suggestion;
|
2021-06-08 03:02:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|