3
\$\begingroup\$

Just as the title states, whats the best way to expose current settings like resolution to my classes? (I know this might have been asked, but I couldn't find anything)

I was thinking of the service-locator design pattern, but I am unsure, as I read that it can be abused easily.( I mean it might not fit this particular use-case )

\$\endgroup\$
3
  • \$\begingroup\$ Comedy "just make them global" option. \$\endgroup\$
    – Tetrad
    Jul 26 '13 at 16:56
  • \$\begingroup\$ You're right, I guess I am just complicating things. Please post that as an answer(perhaps with more reasoning) and I'll accept it. \$\endgroup\$
    – akaltar
    Jul 26 '13 at 17:04
  • 3
    \$\begingroup\$ I bet a search on Stackoverflow would answer this, since it's not specifically gamedev related. \$\endgroup\$
    – House
    Jul 26 '13 at 17:25
10
\$\begingroup\$

Just make them global until you determine that it's a detriment to your system.

Read this: http://c2.com/cgi/wiki?DoTheSimplestThingThatCouldPossiblyWork

Don't add complexity unless you're getting some benefit out of it.

\$\endgroup\$
1
  • \$\begingroup\$ This, 100x over. Also, viva c2.com. \$\endgroup\$
    – Engineer
    Nov 3 '15 at 21:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.