예제 #1
0
        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);
        }
예제 #2
0
        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);
        }