Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lane connection "SUB" manager #1546

Merged
merged 6 commits into from
Apr 27, 2022
Merged

lane connection "SUB" manager #1546

merged 6 commits into from
Apr 27, 2022

Conversation

kianzarrin
Copy link
Collaborator

@kianzarrin kianzarrin commented Apr 25, 2022

phase 2 preparation for #354. continuation of #1545
TMPE.zip

This PR has no functional change. Just moving code from `Lane Connection manager to.

In this PR there is only one instance of the SUB manager which handles both road/track connections. This is just a preparation for the next PR where There will be 2 sub managers and I will change the code Like this.

// this is my plan for the next PR:
public class LaneConnectionManger {
- SubManager = new LaneConnectionSubManager(LaneEndTransitionGroup.ALL); // step 2
+ Road = new LaneConnectionSubManager(LaneEndTransitionGroup.Road); // step 3
+ Track = new LaneConnectionSubManager(LaneEndTransitionGroup.Track); // step 3

// usage: depending on the context ...
- LaneConnectionManager.Instance.Sub.SomeMethod(...); // replace this line ...
+ LaneConnectionManager.Instance.Road.SomeMethod(...); // with this line ...
+ LaneConnectionManager.Instance.Track.SomeMethod(...); // or this line.

Next PR will be final and will make major changes to persistency/UI code. To avoid a giant PR I decided to break it down into multiple PRs.


Compatibility with external mods:

I fixed a bug in TMPE.API that failed to get ManagersFactory. Now it is working.

For backward compatibility with my mods I did not remove implementations of ILaneConnectionManager from LaneConnectoinManager even if I didn't call them from TMPE.

used TMPE API in my mods:
HUT-DCR.zip

EDIT: I cherry picked the API fix and created #1548. I need this hotfix in both Test/Stable before I can upload my mods to WS.

@kianzarrin kianzarrin self-assigned this Apr 25, 2022
@originalfoo originalfoo added code cleanup Refactor code, remove old code, improve maintainability LANE ROUTING Feature: Lane arrows / connectors labels Apr 25, 2022
@kianzarrin kianzarrin marked this pull request as ready for review April 25, 2022 15:57
@originalfoo originalfoo added the API API for external mods label Apr 25, 2022
Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I also checked Roundabout Builder mod and it doesn't use any of the lane connections stuff so should be unaffected by this and planned future PRs.

@kianzarrin kianzarrin mentioned this pull request Apr 25, 2022
@kianzarrin kianzarrin added the DO NOT MERGE YET Don't merge this PR, even if approved, until further notice label Apr 25, 2022
@kianzarrin kianzarrin added this to the 11.6.5.3 milestone Apr 25, 2022
Base automatically changed from 354-prepare-cleaned to master April 27, 2022 20:10
@kianzarrin kianzarrin merged commit 40cb18a into master Apr 27, 2022
@kianzarrin kianzarrin deleted the 354-phase2 branch April 27, 2022 20:22
@originalfoo originalfoo removed the DO NOT MERGE YET Don't merge this PR, even if approved, until further notice label Apr 27, 2022
originalfoo added a commit that referenced this pull request May 22, 2022
- [Meta] This release adds a new language, updates translations, and improves lane routing
- [New] Veitnamese translation #1551 (DucAnhLam)
- [Updated] Separate road and track lane routing #1550 #1546 #1545 #354 (kianzarrin)
- [Updated] Translations for multiple languages #1551 #1344 (Nguyễn Tài Đức, OldEj, AduitSSH, Chamëleon, 문주원, krzychu124, shg166, John Lok Ho, Márcio Saeger, DucAnhLam, DNSE, Arne Peirs, Neoone, Fatih YILDIRIM, Zeldslayer, GiorgioHerbie, krzychu124)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API for external mods code cleanup Refactor code, remove old code, improve maintainability LANE ROUTING Feature: Lane arrows / connectors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants