Beispiel #1
0
        public Func <Equipment, bool> ValidateHasInfluence(InfluenceOptions hasInfluenceArg)
        {
            return((item) =>
            {
                switch (hasInfluenceArg)
                {
                case (InfluenceOptions.None):
                    return item.Influence.Count == 0;

                case (InfluenceOptions.One):
                    return item.Influence.Count == 1;
                }
                throw new InvalidOperationException("Invalid matching item class validation");
            });
        }
Beispiel #2
0
        public Action <Equipment, AffixManager, CurrencyModifiers> AddInfluence(InfluenceOptions addInfluenceArgs)
        {
            return((item, affixManager, currencyModifier) => {
                switch (addInfluenceArgs)
                {
                case InfluenceOptions.Hunter:
                    item.Influence.Add(Influence.Hunter);
                    break;

                case InfluenceOptions.Crusader:
                    item.Influence.Add(Influence.Crusader);
                    break;

                case InfluenceOptions.Redeemer:
                    item.Influence.Add(Influence.Redeemer);
                    break;

                case InfluenceOptions.Warlord:
                    item.Influence.Add(Influence.Warlord);
                    break;

                case InfluenceOptions.Random:
                    var influences = (Influence[])Enum.GetValues(typeof(Influence));
                    influences = influences.Where(x => !item.Influence.Contains(x)).ToArray();
                    var index = _random.Next(influences.Length);
                    item.Influence.Add(influences[index]);
                    break;

                case InfluenceOptions.One:
                    throw new NotImplementedException();
                    break;

                case InfluenceOptions.None:
                    throw new NotImplementedException();
                    break;
                }
            });
        }