Question re: modules and cross-mod namespaces

Talk nerdy to us here.
Post Reply
aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Question re: modules and cross-mod namespaces

Post by aede_ofThuul » November 10th, 2020, 6:54 pm

Hello!

I've been trying to figure out how to make multiple mods use the same classes but be able to be used either together or separately without Reflection, like some of the NRaas mods (and modules of mods) seem to do, and I feel like the reason I'm not seeing it is that I don't know the terminology for describing what I'm trying to learn how to do. Is there a technical term for what a mod and its modules are to each other? Or how all the mods in the NRaas suite that use the Common class or CommonSpace namespace are interacting?

I know the most straightforward way to accomplish what I'm aiming for is just to make a base mod containing the shared classes and have the others reference it, and that's probably going to be my preliminary solution; but it seems like the way NRaas mods handle this is a little simpler for downloaders, so I'd like to provide that kind of convenience if I can.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7618
Joined: December 30th, 2011, 6:00 pm
Answers: 82
Contact:

Question re: modules and cross-mod namespaces

Post by Chain_Reaction » November 13th, 2020, 12:20 am

aede_ofThuul wrote:
November 10th, 2020, 6:54 pm
Is there a technical term for what a mod and its modules are to each other?
There's no real magic going on here. The modules reference the base mod's DLL when they are built so it allows them to use it's classes.
aede_ofThuul wrote:
November 10th, 2020, 6:54 pm
Or how all the mods in the NRaas suite that use the Common class or CommonSpace namespace are interacting?
Each mod uses it's own instance of the Common class. It's just a shared library for convenience sake. In the places they do interact, like Overwatch export/import, reflection is used.

aede_ofThuul
Reactions:
Posts: 50
Joined: April 26th, 2020, 5:37 am

Question re: modules and cross-mod namespaces

Post by aede_ofThuul » November 13th, 2020, 9:28 am

Oh, that's less complicated than I was assuming! It sounds like base-mod-plus-modules really is the way to go, then - thank you!

Post Reply