Is there an Pattern or good practice guide to develop a program designed to load MODS?
Trying Google for MOD practice just come with a lot of gaming specifics mod, I'm more interested in the core structure. Not for game purpose. But I'll take Minecraft or Factorio as an good example.
In Minecraft or Factorio, you have the base game with it's behavior, then you can modify the base game, the behavior and add or remove stuff with mods, by simple put they in the "MOD" folder.
OK, I know you can load JAR (Java) or an DLL(.NET), and I did it by creating an public interface in a JAR/DLL, then importing it to the mod project, create the class or whatever implementation need for the interface compile it into to the JAR/DLL, put on the mod folder, and scan the folder for some JAR/DLL, scan for implementations from the interface and then dynamic invoke an instance of the object.
Great, but looks more like a "guess" "I guess that how it is done, at least it works but..."
Let's take a simple example. Imagine that you have a simple form, let's say user register with name and email, simple enough, it doesn't have any fancy validation like highlight with red when it's is empty. Just the inputs and the OK/Cancel buttons.
Then you can add a more complex form that has more fields, highlight any blank field, add more buttons and change the OK and cancel for something else.
OK I know you can do it with numerous ways like having the fields and rules on a database, or hard-coding every possible way, create some basic "form factory" or "form builder", or whatever other solution that is available. What I'm really interested is on: How can I do it using the MOD concept from the games?
But I'm having bad luck trying to find something useful, maybe I'm looking for the wrong KEYWORD instead of MOD I should use ...... Or simple there is no such "guide, best practice, whatever" yet and I just need to find the best way to Load(mods) and Expose(events, interfaces) every thing that think is needed.
Aucun commentaire:
Enregistrer un commentaire