Esempio n. 1
0
        public ProfileAggregate(Guid id, User user, Guid chartId, string name, Track track, IDateTimeProvider datetime, IPlaceFinder placeFinder, IElevationService elevationService)
            : this()
        {
            if (!track.HasElevation())
            {
                elevationService.ImportElevationTo(track);
            }

            var profilePlaces = CreateProfilePlaces(user.Id, track, placeFinder);
            var result        = CreateResult(user, track, profilePlaces);
            var legs          = CreateLegs(track, profilePlaces);

            var data = new TrackAnalyzer().Analyze(track);

            RaiseEvent(new ProfileCreated(id, user.Id, chartId, name, datetime.Now, track, data.Ascending, data.Descending, data.HighestPoint, data.LowestPoint, data.Climbs, profilePlaces, legs, result));
        }