Esempio n. 1
0
 private void LoadAllChampions()
 {
     AllChampions = new ChampionList("AllChampions");
     LoadAllChampionsRiotApi(); //Use api to get all champions
     if (AllChampions.getCount() < 1)
     {
         LoadAllChampionsLocal();
     }
     AllChampions.ChampionsChanged += (s, args) => StaticSerializer.SerializeObject(AllChampions, StaticSerializer.FullPath_AllChampions);
     if (!File.Exists(StaticSerializer.FullPath_AllChampions))
     {
         StaticSerializer.SerializeObject(AllChampions, StaticSerializer.FullPath_AllChampions);
     }
 }
Esempio n. 2
0
        private string CreateStringOfChampionsInChampionList(ChampionList c)
        {
            //The client accepts regex commandos

            string returnValue = "";

            for (int i = 0; i < c.getCount(); i++)
            {
                returnValue += c.getChampion(i) + "|";
            }

            //replace whitespace with \s (regex space)
            returnValue = returnValue.Replace(" ", "\\s");

            //remove last |
            if (returnValue.Length > 0)
            {
                returnValue = returnValue.Substring(0, returnValue.Length - 1);
            }

            return(returnValue);
        }