Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Game data container

$
0
0
A big game project contains a lot of runtime data like List of all world objects List of all players Game states Viewport ... I have to pass a lot of these data to most of my classes. So I have a huge list of parameters in every constructor. What's the best practice to avoid this mass of parameters? Is it recommended to summarize all data to one class (something like "GameData") and pass this container to all methods and classes? Is there a common name for this container in game development? I'm a bit worried, because if I pass this class to all classes and methods, I get something like a global variable. Thanks a lot for your advice!

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>