Exemplo n.º 1
0
 public RouteStopAdded(Guid routeId, StopName name, TimeOfDay timeOfDay, Position position)
 {
     RouteId   = routeId;
     Name      = name;
     TimeOfDay = timeOfDay;
     Position  = position;
 }
Exemplo n.º 2
0
        public void AddSource(StopName name, TimeOfDay timeOfDay, Position position)
        {
            if (Status != RouteStatus.Planned)
            {
                throw new InvalidOperationException("Can only set source planned routes.");
            }
            if (Destination != null && timeOfDay < Destination.TimeOfDay)
            {
                throw new InvalidOperationException("Route source time should come before destination time.");
            }

            Publish(new RouteSourceAdded(Id, name, timeOfDay, position));
        }
Exemplo n.º 3
0
        public void AddStop(StopName name, TimeOfDay timeOfDay, Position position)
        {
            if (Status != RouteStatus.Planned)
            {
                throw new InvalidOperationException("Can only set source planned routes.");
            }
            if (Source == null || Destination == null)
            {
                throw new InvalidOperationException("Route source and destination should be set first.");
            }
            if (timeOfDay <= Source.TimeOfDay || timeOfDay >= Destination.TimeOfDay)
            {
                throw new InvalidOperationException("Route stop time should be between planned source and destination time.");
            }

            Publish(new RouteStopAdded(Id, name, timeOfDay, position));
        }
Exemplo n.º 4
0
        public void AddDestination(StopName name, TimeOfDay timeOfDay, Position position)
        {
            if (Status != RouteStatus.Planned)
            {
                throw new InvalidOperationException("Can only add destination to planned routes.");
            }
            if (Source == null)
            {
                throw new InvalidOperationException("Route source should be set first.");
            }
            if (timeOfDay <= Source.TimeOfDay)
            {
                throw new InvalidOperationException("Route destination time should come after source time.");
            }

            Publish(new RouteDestinationAdded(Id, name, timeOfDay, position));
        }
Exemplo n.º 5
0
 public Stop(StopName name, TimeOfDay timeOfDay, Position position)
 {
     Name      = name;
     TimeOfDay = timeOfDay;
     Position  = position;
 }