예제 #1
0
        public bool SetRegenSettings(IEnumerable <string> lines)
        {
            var  split = RegenUtil.Split(lines);
            bool any   = false;

            foreach (var s in split)
            {
                var key   = s.Key;
                var value = s.Value;
                switch (key)
                {
                case nameof(Ball):
                    Ball = Aesthetics.GetBallFromString(value);
                    break;

                case nameof(Shiny):
                    ShinyType = Aesthetics.GetShinyType(value);
                    break;

                case nameof(Language):
                    Language = Aesthetics.GetLanguageId(value);
                    break;

                default:
                    continue;
                }
                any = true;
            }
            return(any);
        }
예제 #2
0
        public bool SetRegenSettings(IEnumerable <string> lines)
        {
            var  split = RegenUtil.Split(lines);
            bool any   = false;

            foreach (var s in split)
            {
                var key   = s.Key;
                var value = s.Value;
                switch (key)
                {
                case nameof(Ball):
                    Ball = Aesthetics.GetBallFromString(value);
                    break;

                case nameof(Shiny):
                    ShinyType = Aesthetics.GetShinyType(value);
                    break;

                case nameof(Language):
                    Language = Aesthetics.GetLanguageId(value);
                    break;

                case nameof(Ability):
                    Ability = Enum.TryParse(value, out AbilityRequest ar) ? ar : AbilityRequest.Any;
                    break;

                case nameof(Alpha):
                    Alpha = value == "Yes";
                    break;

                default:
                    continue;
                }
                any = true;
            }
            return(any);
        }