public RouteStopAdded(Guid routeId, StopName name, TimeOfDay timeOfDay, Position position) { RouteId = routeId; Name = name; TimeOfDay = timeOfDay; Position = position; }
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)); }
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)); }
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)); }
public Stop(StopName name, TimeOfDay timeOfDay, Position position) { Name = name; TimeOfDay = timeOfDay; Position = position; }