Beispiel #1
0
 public static float GetValue(Heroes item, Targets.Heroes target)
 {
     try
     {
         var value = item.GetValueFunc(target.Hero);
         return value > 1 ? value : 1;
     }
     catch (Exception ex)
     {
        Chat.Print(ex);
         return 0;
     }
 }
Beispiel #2
0
 public static float CalculatedWeight(Heroes item, Targets.Heroes target, bool simulation = false)
 {
     try
     {
         if (item.Value == 0)
         {
             return 0;
         }
         var value = item.Value * GetValue(item, target) /  item.MaxValue;
         return float.IsNaN(value) || float.IsInfinity(value) ? 0 : value;
     }
     catch (Exception ex)
     {
         Chat.Print(ex);
     }
     return 0;
 }