/// <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(); }
/// <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]); }
/// <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; }
/// <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; }