Woodside-HS / JSGame_2018

Xenology
2 stars 0 forks source link

[Inner] configuration objects need not be and should not be global #22

Open lorankary opened 6 years ago

lorankary commented 6 years ago

All the configuration objects in all the files in the config folder can and should be properties of some other class. For example, 'map_config' should be a property of the MapManager class and not in the global name space. Let's put them all where they belong.

claytonwramsey commented 6 years ago

I'm unwilling to put data in the same place as the code. In the future I think I'll read all config data off of some kind of config.json file.

lorankary commented 6 years ago

Please see this article on the subject of encapsulation: https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)

And this article on why globals in javascript are bad: https://softwareengineering.stackexchange.com/questions/277279/why-are-globals-bad-in-javascript