Beispiel #1
0
        private void RemoveRunnerMethod(Runner obj)

        {
            SelectedRunners.Remove(obj);
            Runners.Add(obj);
            SelectedRunnersCount--;
        }
        public bool AddRunner(string name, string fractionalValue)
        {
            try
            {
                var runner = RunnerFactory.CreaterRunner("HORSE");
                if (!runner.SetRunnerName(name))
                {
                    return(false);
                }
                var value = fractionalValue.Split('/');

                if (value.Length != 2)
                {
                    return(false);
                }
                if (!runner.SetFractionalOddPrice(numerator: value[0], denominator: value[1]))
                {
                    return(false);
                }
                WinningMargin += 100 / runner.FractionalValue;

                Runners.Add(runner);
                return(true);
            }
            catch (Exception ex)
            {
                Logger.Log(message: ex.Message, stacktrace: ex.StackTrace);
                return(false);
            }
        }
Beispiel #3
0
    /// <summary>
    /// Add coroutine to a parallel group and start it
    /// </summary>
    public static void AsParallelGroup(this IEnumerator coroutine, MonoBehaviour parent, string groupName)
    {
        if (!Runners.ContainsKey(groupName))
        {
            Runners.Add(groupName, 0);
        }

        Runners[groupName]++;
        parent.StartCoroutine(DoParallel(coroutine, parent, groupName));
    }
Beispiel #4
0
 public void Add(NFLPlayer player)
 {
     if (Runners.Contains(player))
     {
         Announce(string.Format("Duplicate player {0}", player.PlayerName));
     }
     else
     {
         Runners.Add(player);
     }
 }
Beispiel #5
0
 public void Add(NFLPlayer player)
 {
     if (Runners.Contains(player))
     {
         Announce(
             $"Duplicate player {player.PlayerName}");
     }
     else
     {
         Runners.Add(player);
     }
 }
Beispiel #6
0
        private void ProcessOrderRunnerChange(OrderRunnerChange orc)
        {
            if (orc.SelectionId is null)
            {
                return;
            }
            var selectionId = (long)orc.SelectionId;

            if (!Runners.ContainsKey(selectionId))
            {
                Runners.Add(selectionId, new RunnerCache(selectionId));
            }

            Runners[selectionId].OnOrderChange(orc);
        }
Beispiel #7
0
        /// <summary>
        /// Adds a new <see cref="Runner"/> to <see cref="Runners"/>.
        /// </summary>
        public void AddRunner()
        {
            if (!_canAddRunner)
            {
                return;
            }
            Runner runner = new Runner(String.Format(Language.DefaultRunnerName, Runners.Count + 1), Language.DefaultRunnerOdds);

            runner.PropertyChanged += Runner_PropertyChanged;
            Runners.Add(runner);

            ReCalculateRaceMargin();
            _canAddRunner = Runners.Count < _maxRunnerCount;
            OnPropertyChanged(nameof(CanAddRunner));
        }
Beispiel #8
0
        private void ProcessRunnerChange(RunnerChange runnerChange)
        {
            if (runnerChange.SelectionId is null)
            {
                return;
            }
            var selectionId = (long)runnerChange.SelectionId;

            if (!Runners.ContainsKey(selectionId))
            {
                Runners.Add(selectionId, new RunnerCache(selectionId));
            }

            Runners[selectionId]
            .OnRunnerChange(runnerChange, LastPublishedTime);
        }
 public bool AddRunner(Runner horse)
 {
     try
     {
         if (horse == null)
         {
             return(false);
         }
         if (!horse.IsFractionalOddPriceValid() || !horse.IsNameValid())
         {
             return(false);
         }
         Runners.Add(horse);
         WinningMargin += 100 / horse.FractionalValue;
         return(true);
     }
     catch (Exception ex)
     {
         Logger.Log(message: ex.Message, stacktrace: ex.StackTrace);
         return(false);
     }
 }
Beispiel #10
0
 public void Add(NFLPlayer player)
 {
     Runners.Add(player);
 }
 public virtual T AddRunner(Action <IContainer> runner)
 {
     Runners.Add(runner);
     return(this as T);
 }
Beispiel #12
0
 public void AddRunner(Runner runner)
 {
     Runners.Add(runner);
 }
Beispiel #13
0
 private void AddRunner(RunnerViewModel runner)
 {
     _Dispatcher.Invoke(() => Runners.Add(runner));
 }