Ejemplo n.º 1
0
        private BotUserControl ReturnBotControl(ICompetitor botClient)
        {
            BotUserControl botUserControl = null;

            foreach (var stageList in _tournamentLadderViewModel.StageLists)
            {
                var tempViewControl = stageList.FirstOrDefault(f => f.ViewModel.BotClient != null && f.ViewModel.BotClient.Id == botClient.Id);
                if (tempViewControl != null)
                {
                    botUserControl = tempViewControl;
                }
            }

            return(botUserControl);
        }
Ejemplo n.º 2
0
 private void UpdateTournamentLadder(BotUserControl botControl, double score)
 {
     if ((int)score == 1)
     {
         if (_tournamentLadderViewModel.StageLists[botControl.ViewModel.CurrentStage].Count > 1)
         {
             var nextStageControl = _tournamentLadderViewModel.StageLists[botControl.ViewModel.CurrentStage + 1].First(f => f.Id == botControl.NextStageTargetId);
             botControl.ViewModel.CurrentStage++;
             nextStageControl.ViewModel = botControl.ViewModel;
         }
     }
     if ((int)score == 0)
     {
         botControl.ViewModel.StilInGame = false;
     }
 }