Пример #1
0
        public static Travel Random(int day)
        {
            var travel = new Travel {
                Day = day,
            };

            var length = TripStream.Random.Next(1, 20);

            for (var i = 0; i < length; i++)
            {
                var movement = new Movement
                {
                    Direction = TripStream.RandomDirection(), Distance = TripStream.Random.NextDouble() * 100
                };

                travel.Movements.Add(movement);
            }

            return(travel);
        }
Пример #2
0
 public void Apply(Travel e, Trip trip) => trip.Traveled += e.TotalDistance();