mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -05:00
Remove GameSync/SecureValue from SAV tab (still lives in Block Data) Remove inaccessible items from FRLG/E key items
24 lines
1.0 KiB
C#
24 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Clears contents of boxes by deleting all that satisfy a criteria.
|
|
/// </summary>
|
|
public sealed record BoxManipClear(BoxManipType Type, Func<PKM, bool> Criteria, Func<SaveFile, bool> Usable) : BoxManipBase(Type, Usable)
|
|
{
|
|
public BoxManipClear(BoxManipType Type, Func<PKM, bool> Criteria) : this(Type, Criteria, _ => true) { }
|
|
|
|
public override string GetPrompt(bool all) => all ? MessageStrings.MsgSaveBoxClearAll : MessageStrings.MsgSaveBoxClearCurrent;
|
|
public override string GetFail(bool all) => all ? MessageStrings.MsgSaveBoxClearAllFailBattle : MessageStrings.MsgSaveBoxClearCurrentFailBattle;
|
|
public override string GetSuccess(bool all) => all ? MessageStrings.MsgSaveBoxClearAllSuccess : MessageStrings.MsgSaveBoxClearCurrentSuccess;
|
|
|
|
public override int Execute(SaveFile sav, BoxManipParam param)
|
|
{
|
|
var (start, stop, reverse) = param;
|
|
return sav.ClearBoxes(start, stop, Method);
|
|
|
|
bool Method(PKM p) => reverse ^ Criteria(p);
|
|
}
|
|
}
|