示例#1
0
文件: Store.cs 项目: Ceeeeed/TFT-BOT
 public static void BuyAll()
 {
     for (int i = 0; i < Info.store.Length; i++)
     {
         if (Builds.wantedChampions.Contains(Info.store[i].name))
         {
             Champion[] champs          = Array.FindAll(Board.board, x => x.name == Info.store[i].name && Info.store[i].level == 1);
             Champion[] emptyBenchSlots = Array.FindAll(Board.board, x => x.name == ChampionName.None);
             if (champs.Length > 1)   //join
             {
                 ClickBuy(i);
                 Join(Info.store[i].name);
             }
             else if (emptyBenchSlots.Length > 0)     // default
             {
                 for (int j = 0; j < 9; j++)
                 {
                     if (Board.board[i].name == ChampionName.None)
                     {
                         Board.board[i] = Champions.allChampionsFindByName(Info.store[i].name);
                     }
                 }
                 ClickBuy(i);
             }
             else     // no space
             {
                 if (!Builds.buildFound)
                 {
                     Builds.RemoveBuilds();
                 }
                 else
                 {
                     continue;
                 }
                 if (Builds.wantedChampions.Contains(Info.store[i].name))
                 {
                     for (int j = 0; j < 9; j++)
                     {
                         if (Board.board[i].name == ChampionName.None)
                         {
                             Board.board[i] = Champions.allChampionsFindByName(Info.store[i].name);
                         }
                     }
                     ClickBuy(i);
                 }
             }
         }
     }
 }