mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
2cdb5d26db
rename things to be a little more consistent in naming conventions
21 lines
No EOL
1.1 KiB
C#
21 lines
No EOL
1.1 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public sealed class BoxManipClearComplex : BoxManipBase
|
|
{
|
|
private readonly Func<PKM, SaveFile, bool> Criteria;
|
|
public BoxManipClearComplex(BoxManipType type, Func<PKM, SaveFile, bool> criteria) : this(type, criteria, _ => true) { }
|
|
public BoxManipClearComplex(BoxManipType type, Func<PKM, SaveFile, bool> criteria, Func<SaveFile, bool> usable) : base(type, usable) => Criteria = criteria;
|
|
|
|
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)
|
|
{
|
|
bool Method(PKM p) => param.Reverse ^ Criteria(p, sav);
|
|
return sav.ClearBoxes(param.Start, param.Stop, Method);
|
|
}
|
|
}
|
|
} |