The modules and content relationship - TeamMoonstorm/MoonstormSharedUtils GitHub Wiki
The Module and Content relationship
MSU was created in mind for modularity, The ability for systems to be modular allow for a good amount of different workflows and systems for certain aspects of the game. MSU at its core is a Content Loading Framework, which means that it's main tools and purpose is to facilitate the proceess of loading content into the game in a modular way, allowing for each content piece to store its own functionality in a single class.
To accomplish this, MSU's main system is the ModuleBase and the ContentBase systems. these systems co-exist in harmony and one cannot exist without the other.
Content Base:
The ContentBase is an abstract class that is an abstracted representation of a content piece in Risk of Rain 2. As such, ContentBases can be used to represent a myriad of objects, such as ItemDefs, EquipmentDefs, Elites, Artifacts, ETC.
While most if not all aspects of boilerplate work become redundant thanks to ThunderKit's systems, the MSU ContentBase is mainly used for either implementing the full functionality of a content piece (Such as items and equipments), or finishing the functionality of a content piece (Such as setting the default pod prefab for a character body)
More information about the content bases can be found here
Due to their abstract nature, this means that anyone is free to inherit from the ContentBase class and create a SubClass for their own needs.
ModuleBase:
While the ContentBase takes care of representing a content piece in an abstract manner, a ModuleBase is an abstract class that takes care of managing a specific type of ContentBase. By managing a specific type, we mean the ModuleBase has the ability to directly interact with the game's systems without the user's input for making sure said ContentBases work properly and interact with the rest of the game's codebase. it is this reason why ModuleBases and ContentBases co-exist with each other in harmony and are necesary for one and the other to work.
As a general rule of thumb, almost all if not all content base classes have their specific module bases.
More information about the module bases can be found here
Due to their abstract nature, this means that anyone is free to inherit from the ModuleBase class and create a SubClass for their own needs.
I'm still confused, what are the relationship between them?
Think about it this way, the module base looks for their specific related content base classes in your assembly. and then with the game's systems ensures they work properly.