using System; using System.Collections.Generic; namespace PKHeX.Core { public sealed class BoxManipModify : IBoxManip { public BoxManipType Type { get; } public Func Usable { get; set; } public string GetPrompt(bool all) => null; public string GetFail(bool all) => null; public string GetSuccess(bool all) => null; private readonly Action Action; private readonly Action ActionComplex; public bool Execute(SaveFile SAV, BoxManipParam param) { var method = Action ?? (px => ActionComplex(px, SAV)); SAV.ModifyBoxes(method, param.Start, param.Stop); return true; } private BoxManipModify(BoxManipType type, Action action, Func usable = null) { Type = type; Action = action; Usable = usable; } private BoxManipModify(BoxManipType type, Action action, Func usable = null) { Type = type; ActionComplex = action; Usable = usable; } public static readonly IReadOnlyList Common = new List { new BoxManipModify(BoxManipType.ModifyHatchEggs, pk => pk.ForceHatchPKM(), s => s.Generation >= 2), new BoxManipModify(BoxManipType.ModifyMaxFriendship, pk => pk.MaximizeFriendship()), new BoxManipModify(BoxManipType.ModifyMaxLevel, pk => pk.MaximizeLevel()), new BoxManipModify(BoxManipType.ModifyResetMoves, pk => pk.SetMoves(pk.GetMoveSet()), s => s.Generation >= 3), new BoxManipModify(BoxManipType.ModifyRandomMoves, pk => pk.SetMoves(pk.GetMoveSet(true))), new BoxManipModify(BoxManipType.ModifyHyperTrain,pk => pk.SetSuggestedHyperTrainingData(), s => s.Generation >= 7), new BoxManipModify(BoxManipType.ModifyRemoveNicknames, pk => pk.SetDefaultNickname()), new BoxManipModify(BoxManipType.ModifyRemoveItem, pk => pk.HeldItem = 0, s => s.Generation >= 2), }; } }