Example #1
0
 /// <summary>
 /// Parse a condition's line
 /// </summary>
 private void ParseCondition(string line)
 {
     line = line.Remove(0, 10);
     line = line.Trim();
     foreach (char op in operateurs)
     {
         if (line.IndexOf(op) != -1)
         {
             FightConditionEnum e         = FightConditionEnum.Null;
             string             b         = line.Substring(0, line.IndexOf(op));
             FightConditionEnum condition = (FightConditionEnum)Enum.Parse(typeof(FightConditionEnum), b);
             if (Enum.IsDefined(typeof(FightConditionEnum), condition) | condition.ToString().Contains(","))
             {
                 line = line.Remove(0, line.IndexOf(op) + 1);
                 FightCondition c = new FightCondition(condition, line, op, m_Account);
                 m_cond.Add(c);
             }
             else
             {
                 throw new Exception("AI Script : Invalid strategy at line : " + line);
             }
             return;
         }
     }
 }
Example #2
0
 /// <summary>
 /// Parse a condition's line
 /// </summary>
 private void ParseCondition(string line)
 {
     line = line.Remove(0, 10);
     line = line.Trim();
     foreach (char op in operateurs)
     {
         if (line.IndexOf(op) != -1)
         {
             FightConditionEnum e = FightConditionEnum.Null;
             string b = line.Substring(0, line.IndexOf(op));
             FightConditionEnum condition = (FightConditionEnum)Enum.Parse(typeof(FightConditionEnum), b);
             if (Enum.IsDefined(typeof(FightConditionEnum), condition) | condition.ToString().Contains(","))
             {
                 line = line.Remove(0, line.IndexOf(op) + 1);
                 FightCondition c = new FightCondition(condition, line, op, m_Account);
                 m_cond.Add(c);
             }
             else
                 throw new Exception("AI Script : Invalid strategy at line : " + line);
             return;
         }
     }
 }