ubc-minetest-classroom / minetest_classroom

Repo for Mintest Classroom game
GNU General Public License v3.0
10 stars 6 forks source link

Move instantiation of `minetest_classroom` global object to its own mod #9

Closed Lowie375 closed 2 years ago

Lowie375 commented 2 years ago

Continued development of the magnify mod (#6) has revealed an issue with the current MineTest classroom framework: since the minetest_classroom global object is instantiated in the mc_teacher mod, any mod which needs access to that object must be dependent on mc_teacher. This means that mc_teacher can not depend on any other mods which need access to the minetest_classroom global object (as that would create an unresolvable circular dependency). However, development on #6 requires that mc_teacher depend on magnify in order to access its species list after it has been populated, which would cause a circular dependency issue.

I suggest that we move the instantiation of the minetest_classroom global object to a new mod, mc_core, so that all mods that need access to the minetest_classroom global object can be dependent on mc_core instead of mc_teacher, thus resolving the circular dependency issue in #6.

lukasgolson commented 2 years ago

Agreed; this would be a good refactor.

That said, we should also look into making the mc_teacher mod more extendable for all mods to plug into it; e.g., introducing callbacks where appropriate, extensible menus, etc. so that it does not require hard-coding dependencies like what is happening here.

pauldpickell commented 2 years ago

Good catch @Lowie375 and thanks for the quick fix.