Example #1
0
 public Double Modify(BuffTarget target, Double sourceValue)
 {
     if (ModificationsByTarget.ContainsKey(target))
     {
         return ModificationsByTarget[target](sourceValue);
     }
     return sourceValue;
 }
 protected static Double ApplyBuffModifications(BuffTarget buffTarget, Double statValue, ObservableCollection<Buff> buffs)
 {
     if (buffs != null)
     {
         foreach (var buff in buffs)
         {
             statValue = buff.Modify(buffTarget, statValue);
         }
     }
     return statValue;
 }
Example #3
0
 public static Buff New(BuffTarget buffTarget, Func<Double, Double> buffModification)
 {
     return new Buff(new Dictionary<BuffTarget, Func<Double, Double>> { { buffTarget, buffModification } });
 }