mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-22 18:33:14 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
23 lines
844 B
C#
23 lines
844 B
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Modifies contents of boxes by using an <see cref="Action"/> to change data.
|
|
/// </summary>
|
|
public sealed class BoxManipModify : BoxManipBase
|
|
{
|
|
private readonly Action<PKM> Action;
|
|
public BoxManipModify(BoxManipType type, Action<PKM> action) : this(type, action, _ => true) { }
|
|
public BoxManipModify(BoxManipType type, Action<PKM> action, Func<SaveFile, bool> usable) : base(type, usable) => Action = action;
|
|
|
|
public override string GetPrompt(bool all) => string.Empty;
|
|
public override string GetFail(bool all) => string.Empty;
|
|
public override string GetSuccess(bool all) => string.Empty;
|
|
|
|
public override int Execute(SaveFile sav, BoxManipParam param)
|
|
{
|
|
var (start, stop, _) = param;
|
|
return sav.ModifyBoxes(Action, start, stop);
|
|
}
|
|
}
|