Example #1
0
 /// <summary>
 /// Initialises a new instance of the <see cref="Driver"/> class.
 /// </summary>
 /// <param name="name">The driver name.</param>
 /// <param name="code">The driver code.</param>
 /// <param name="team">The driver team.</param>
 /// <param name="finishStatus">The finishing status.</param>
 public Driver(Name name, DriverCode code, string team, FinishStatus finishStatus)
 {
     Name         = Guard.Argument(name, nameof(name)).NotNull();
     DriverCode   = Guard.Argument(code, nameof(code)).NotNull();
     Team         = Guard.Argument(team, nameof(team)).NotNull().NotEmpty().NotWhiteSpace();
     FinishStatus = Guard.Argument(finishStatus, nameof(finishStatus)).NotNull();
 }
Example #2
0
        /// <summary>
        /// Gets trace data for a driver.
        /// </summary>
        /// <param name="code">The driver code.</param>
        /// <returns><see cref="DriverTraceData"/> for the driver.</returns>
        public DriverTraceData GetDataForDriver(DriverCode code)
        {
            if (!_driverTraceData.ContainsKey(code))
            {
                throw new KeyNotFoundException("Driver does not exist in race data.");
            }

            return(_driverTraceData[code]);
        }
Example #3
0
 /// <summary>
 /// Initialises a new instance of the <see cref="DriverTraceData"/> class.
 /// </summary>
 /// <param name="driverCode">The driver code.</param>
 /// <param name="team">The driver team.</param>
 public DriverTraceData(DriverCode driverCode, string team)
 {
     DriverCode = driverCode;
     Team       = team;
 }
Example #4
0
 /// <summary>
 /// Initialises a new instance of the <see cref="DriverRaceData"/> class.
 /// </summary>
 /// <param name="driverCode">The driver code.</param>
 public DriverRaceData(DriverCode driverCode)
 {
     DriverCode = driverCode;
 }