Making game constants/tables available to game logic classes/routines in a modular manner
- by Extrakun
Suppose I have a game where there are several predefined constants and charts (a XP chart, cost of goods and so on). Those could be defined at runtime, or load from files at start-up. The question is how should those logic routines access the constants and charts?
For example, I could try using global variables, but that cause all classes relying on the variables to be tightly coupled with them.