Mario Figueiredo wrote: > It's just a cheap global, since is ubiquitous throughout the entire > application, does behave like a singleton, and is a bit too expensive > to create. A full map in the main application takes 3 or 4 seconds to > instantiate and occupies around 2 Mb of memory.
2MB is not that big. 3-4 seconds to instantiate is a bit worrying, but you should look at improving the efficiency of loading a map rather than insisting that there should be only one map instance. Particularly in the map editor, what if the user wants to copy parts of one map into a second map? I've often wanted to do that with games. Every other editor, from music editors to text editors, allows you to have multiple documents open. Why should game level editors be stuck in the 1980s? While Map is a singleton, editing multiple maps at once is impossible (or at least tiresomely difficult). -- Steven -- https://mail.python.org/mailman/listinfo/python-list