datalurkur / Mountainhome

A detailed and intricate worldsim borrowing from the Dungeon Keeper-style dungeon-building mechanic
You're lookin' at it.
6 stars 2 forks source link

MHCore should not be a Singleton #59

Closed StLoch closed 14 years ago

StLoch commented 14 years ago

Currently it IS and has a few things that require it be such. These things all need access to either the main Window or to one of the ResourceManagers. Instead of relying on MHCore being accessible from everywhere, it would be nice if MHCore were passed to the objects that needed it (or, even better, only the required objects themselves: ResourceManagers, Window, etc...).

StLoch commented 14 years ago

This will likely require changing some ruby code as the objects that NEED the managers and window are all created in ruby. I can pass things in using either pointers and magical casting (for the ResourceManagers and Window) or pass the $mhcore ruby reference and have the new objects use MHCore to look up the appropriate C++ object. This would be an argument for passing the core instead of the actual, needed objects, but I'm still not sure which way I prefer, atm. If we do go with MHCore, we'll need to make it a ManyToMany bound object.

datalurkur commented 14 years ago

I believe Loch has fixed this? I'll let him have the satisfaction of closing the issue.

StLoch commented 14 years ago

yup!