CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Maintenance: Remove all lane connections #1647

Closed krzychu124 closed 2 years ago

krzychu124 commented 2 years ago

Resolves #1646

Simple maintenance tool for removing all lane connections. More info in #1637 @kianzarrin I'm pretty sure that resetting connection database and requesting full routing recalculation should be enough to make it work correctly. Please double-check.

kianzarrin commented 2 years ago

does it also call the notifier to notify AN of changes?

krzychu124 commented 2 years ago

does it also call the notifier to notify AN of changes?

Valid point. Which event it should trigger?

kianzarrin commented 2 years ago

Valid point. Which event it should trigger?

Notifier.OnNodeModified() for every node.

EDIT: the thing is that changes to lane connections triggers rerouting and routing manager in turn invokes the notifier. so it might be that you don't need to take any action except for double checking this actually happens.

krzychu124 commented 2 years ago

Valid point. Which event it should trigger?

Notifier.OnNodeModified() for every node.

EDIT: the thing is that changes to lane connections triggers rerouting and routing manager in turn invokes the notifier. so it might be that you don't need to take any action except for double checking this actually happens.

Yeah, just checked OptionsManager.UpdateRoutingManager(); queues segments to update in the next simulation step and then each RecalculateSegment notifies listeners via OnSegmentNodesModified. All should work.