public static LaneAssignmentDto FromLaneAssignment(ILaneAssignment laneAssignment) { if (laneAssignment == null) { return(null); } LaneAssignmentDto result = new LaneAssignmentDto() { Lane = laneAssignment.Lane, Car = CarDto.FromCar(laneAssignment.Car), ElapsedTime = laneAssignment.ElapsedTime, ScaleSpeed = laneAssignment.ScaleSpeed, Position = laneAssignment.Position, Points = laneAssignment.Points }; return(result); }
public static RaceDto FromRace(IRace race) { if (race == null) { return(null); } RaceDto result = new RaceDto() { RaceNumber = race.RaceNumber, State = race.State.ToString() }; foreach (ILaneAssignment laneAssignment in race.LaneAssignments) { result.LaneAssignments.Add(LaneAssignmentDto.FromLaneAssignment(laneAssignment)); } return(result); }