/* ==================== pointerhub.h ==================== version 0.0.1 ==================== PointerHub is a place to put all the "global variables" without actually making them global. Pointers to all the major objects in the game are stored statically in PointerHub. Any classes that need access to these "virtually global" objects can inherit from PointerHub since the pointers to the objects are stored statically. Thus, they can be accessed by any object which inherits from PointerHub without loading up each individiual PointerHub object (there may in fact not be any PointerHub objects at all in existence since they are not needed). Objects that need to be included in PointerHub (such as Map and RenderMan) can self-include themselves into PointerHub when they are constructed for ease of use. CHANGELOG: ---------------------- 0.0.1 - first run. everything seems to work so far. you can add more pointers to the list if later needed. the Get functions are really not totally necessary, but they are included for the benefit of classes that do *not* inherit from PointerHub. TO-DO & EXPANSION LIST ---------------------- =============================================================== */ #ifndef POINTERHUB_H #define POINTERHUB_H //#include "../map/map.h" //#include "../visual/renderman.h" // declared elsewhere: class Map; class RenderMan; class PG_Label; class PG_MapWindow; class PointerHub { public: PointerHub(); ~PointerHub(); static void SetMap(Map* m); static Map* GetMap(); static void SetRenderMan(RenderMan* r); static RenderMan* GetRenderMan(); static void SetMapWindow(PG_MapWindow* mw); static PG_MapWindow* GetMapWIndow(); static void SetStatus(PG_Label* s); static PG_Label* GetStatus(); protected: static Map* themap; // "map" causes conflicts in some files that use SDL / ParaGUI static RenderMan* rm; static PG_MapWindow* mw; // active map window (if there is one) static PG_Label* status; // status bar (if there is one) }; #endif