Beispiel #1
0
 private void Parse()
 {
     string[] parts = _info.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
     for (int i = 0; i < parts.Length; i++)
     {
         parts[i] = parts[i].Trim();
         int n;
         if (i == 0 && (!parts[i].Contains("cr") || !int.TryParse(parts[i].Substring(0, parts[i].Length - 2), out n)))
         {
             RewardObject o = new RewardObject(parts[i]);
             o.RewardGiver = E_RewardGivers.Lotus;
             Rewards.Add(o);
         }
         if (parts[i].Contains("cr"))
         {
             RewardCredits c = new RewardCredits(parts[i]);
             c.RewardGiver = E_RewardGivers.Lotus;
             Rewards.Add(c);
         }
         if (i != 0 && parts[i].Contains("("))
         {
             Mission = new Mission(parts[i]);
         }
     }
 }
Beispiel #2
0
 private void Parse()
 {
     string[] parts = _info.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
     if (parts[0].Contains("x"))
     {
         RewardObject o = new RewardObject(parts[0].Trim());
         o.RewardGiver = E_RewardGivers.Lotus;
         Rewards.Add(o);
     }
     else
     {
         RewardCredits c = new RewardCredits(parts[0].Trim());
         c.RewardGiver = E_RewardGivers.Lotus;
         Rewards.Add(c);
     }
     if (parts[1].Contains("PHORID SPAWN"))
     {
         parts[1] = parts[1].Replace("PHORID SPAWN", "");
         Description = "Phorid Spawn";
     }
     else
         Description = "Outbreak";
     Mission = new Mission(parts[1].Trim());
 }
Beispiel #3
0
        private void Parse()
        {
            string pattern = @"^\d+[K,cr]$";
            Regex rgx = new Regex(pattern);
            string[] parts = _info.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            Mission = new Models.Mission(parts[1]);
            parts = parts[0].Split("VS.".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            foreach (string side in parts)
            {
                string[] ri = side.Trim().Split("()".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                MatchCollection matches = rgx.Matches(ri[1]);
                if (matches.Count > 0)//ri[1].Contains("x "))
                {
                    RewardCredits r = new RewardCredits(ri[1]);
                    r.RewardGiver = (E_RewardGivers)Enum.Parse(typeof(E_RewardGivers), ri[0]);
                    Rewards.Add(r);
                }
                else
                {
                    RewardObject r = new RewardObject(ri[1]);
                    r.RewardGiver = (E_RewardGivers)Enum.Parse(typeof(E_RewardGivers), ri[0]);
                    Rewards.Add(r);
                }
            }

        }