コード例 #1
0
        private void OnSelectMenuItem(Runner obj)

        {
            SelectedRunners.Add(obj);
            Runners.Remove(obj);
            SelectedRunnersCount++;
        }
コード例 #2
0
 /// <summary>
 /// Removes <see cref="SelectedRunner"/> from <see cref="Runners"/>.
 /// </summary>
 public void RemoveRunner()
 {
     if (!_canRemoveRunner || SelectedRunner == null || !Runners.Contains(SelectedRunner))
     {
         return;
     }
     Runners.Remove(SelectedRunner);
     SelectedRunner.PropertyChanged -= Runner_PropertyChanged;
     ReCalculateRaceMargin();
     _canAddRunner = Runners.Count < _maxRunnerCount;
     OnPropertyChanged(nameof(CanAddRunner));
 }
コード例 #3
0
        private void OnRunnerDied(BaseRunner runner)
        {
            Runners.Remove(runner);
            KillAllRunners -= runner.Die;

            if (Runners.Count < 1)
            {
                GetTree().Paused = true;

                Reset();
                GameOverEvent?.Invoke();
            }
        }
コード例 #4
0
        private async Task <List <Runner> > GetRunnersbyEvent()

        {
            var returned = await RunnerServices.GetRunnersByEventID(Event.Id);

            SelectedRunners      = new ObservableCollection <Runner>(returned);
            SelectedRunnersCount = SelectedRunners.Count;
            foreach (var runner in SelectedRunners)
            {
                Runners.Remove(Runners.SingleOrDefault(i => i.Id == runner.Id));
            }

            IsBusy = false;
            return(returned);
        }
コード例 #5
0
 private void RemoveRunner(RunnerViewModel runner)
 {
     _Dispatcher.Invoke(() => Runners.Remove(runner));
     _Dispatcher.Invoke(() => ClearStatuses(runner.ConnectionId));
 }