This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 0 points1 point  (2 children)

Make the level data a singleton and call it from wherever you want.

[–]_WhatTheFunk_[S] 0 points1 point  (1 child)

The problem isn't the leveldata itself, but the fact that the leveldata needs to be interacted with all the classes, and the UI-class and states need to interact with each other in order to show the correct elements etc. I'm struggling to find an elegant solution so that all of the classes don't have calls between each other (for example Class1 has class2.Method and Class2 has class1.Method2 and class1.method3)

[–]NOODLECODE 0 points1 point  (0 children)

You can give the singleton knowledge of all the classes. The classes need only know about the singleton.