Exemplo n.º 1
0
        /// <summary>
        /// Add lap data to race.
        /// </summary>
        /// <param name="lapCount">The lap count.</param>
        /// <param name="timeDelta">The time delta.</param>
        public void AddLap(LapCount lapCount, TimeDelta timeDelta)
        {
            Guard.Argument(lapCount, nameof(lapCount))
            .NotNull()
            .Require(x => !_timeDeltas.ContainsKey(lapCount), count => "Cannot add the same lap multiple times.");

            Guard.Argument(timeDelta, nameof(timeDelta))
            .NotNull();

            _timeDeltas.Add(lapCount, timeDelta);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add lap data to race.
        /// </summary>
        /// <param name="lapCount">The lap count.</param>
        /// <param name="lapData">The lap data.</param>
        public void AddLap(LapCount lapCount, LapData lapData)
        {
            Guard.Argument(lapCount, nameof(lapCount))
            .NotNull()
            .Require(x => !_lapData.ContainsKey(lapCount), count => "Cannot add the same lap multiple times.");

            Guard.Argument(lapData, nameof(lapData))
            .NotNull();

            _lapData.Add(lapCount, lapData);
        }