Esempio n. 1
0
 public void ActOnEffect(SDict dict)
 {
     if (dict.keys.Contains(s))
     {
         if (type == EffectorType.Add)
         {
             dict.SetValue(s, dict.GetValue(s) + f);
         }
         if (type == EffectorType.Divide)
         {
             dict.SetValue(s, dict.GetValue(s) / f);
         }
         if (type == EffectorType.Minus)
         {
             dict.SetValue(s, dict.GetValue(s) - f);
         }
         if (type == EffectorType.Multiply)
         {
             dict.SetValue(s, dict.GetValue(s) * f);
         }
         if (type == EffectorType.Equalize)
         {
             dict.SetValue(s, f);
         }
     }
 }
Esempio n. 2
0
 public bool passCheck(SDict newD)
 {
     dict = newD;
     if (available(propertyName))
     {
         if (checkType == propertyCheck.GreaterThan)
         {
             if (dict.GetValue(propertyName) > value)
             {
                 return(true);
             }
         }
         else if (checkType == propertyCheck.EqualTo)
         {
             if (dict.GetValue(propertyName) == value)
             {
                 return(true);
             }
         }
         else if (checkType == propertyCheck.GreaterOrEqual)
         {
             if (dict.GetValue(propertyName) >= value)
             {
                 return(true);
             }
         }
         else if (checkType == propertyCheck.LowerOrEqual)
         {
             if (dict.GetValue(propertyName) <= value)
             {
                 return(true);
             }
         }
         else if (checkType == propertyCheck.LowerThan)
         {
             if (dict.GetValue(propertyName) < value)
             {
                 return(true);
             }
         }
         else if (checkType == propertyCheck.NA)
         {
             return(true);
         }
         return(false);
     }
     return(false);
 }