Update() public method

public Update ( ) : void
return void
Example #1
0
        public bool ApplyModifiers(List <AbilityModifier> list)
        {
            var grouped = list.GroupBy(x => x.Ability.Type).Select(x => (x.Key, x.Sum(mod => mod.Modifier)));
            var updates = grouped.Select(x => Abilities.Update(x.Key, x.Item2, false)).ToList();

            return(updates.All(success => success));
        }
Example #2
0
        private bool ApplyEffect(TraitEffectDescModel traitEffect, bool manual)
        {
            switch (traitEffect.TargetType)
            {
            case EffectTarget.Ability:
                return(Abilities.Update(traitEffect.TargetId, traitEffect.Value, manual));

            case EffectTarget.Skill:
                return(Skills.Update(traitEffect.Skill, traitEffect.Value, manual));

            default:
                return(true);
            }
        }