uludaggonul / snow-dots

Automatically exported from code.google.com/p/snow-dots
0 stars 0 forks source link

Easier way to init and customize singletons from script. #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Talking with Josh--

Right now the easiest way to set the properties of a singleton, like the 
dotsTheDrawablesManager, is with dotsTheMachineSettings and an XML file.  This 
is not convenient during development or when e.g. moving a laptop from work 
station to work station.

To make changes from a script is painful:

dotsTheDrawablesManager.reset;
dm = dotsTheDrawablesManager.theObject;
dm.something = 'custom';
dm.else = 'local flavor';
etc...

Which could get large and out of hand.

---

Would be easier to have a one-line initializer with custom properties (think 
displayIndex and displayRect)

dm = dotsTheDrawablesManager.set('displayIndex', 1, 'displayRect', []);

which might reset the object and apply the given property values.

Original issue reported on code.google.com by Benjamin.Heasly on 1 Jul 2010 at 9:06

GoogleCodeExporter commented 8 years ago
dotsAllSingletions.reset now takes property-value pairs, which allows easier 
setting from a script and overrides and XML settings.

Original comment by Benjamin.Heasly on 3 Aug 2010 at 6:09

GoogleCodeExporter commented 8 years ago

Original comment by Benjamin.Heasly on 3 Aug 2010 at 6:10