Esempio n. 1
0
 private async Task Tick()
 {
     try
     {
         FeedIterator <Player> feedIterator = PlayersRepository.GetAllAdventuringPlayers();
         List <Task>           playerTasks  = new List <Task>();
         while (feedIterator.HasMoreResults)
         {
             foreach (Player player in await feedIterator.ReadNextAsync())
             {
                 Task playerTask = TickSinglePlayer(player);
                 playerTasks.Add(playerTask);
             }
         }
         await Task.WhenAll(playerTasks.ToArray());
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }