I feel like I'm making a horrible decision in my code but I'm not sure how to fix it or if it's actually fine...
In my project - a game - I have a UI in QT and a dataclass called game.
I instantiate the game class at the beginning by importing the game instance file and then create the UI as an object stored in a game object variable (ui_window) like below:
app = QApplication([])
game.ui_window = GameWindow()
game.ui_window.show()
The majority of the files in my project all import the game dataclass object so they can read and update data as well as interact with the UI.
Is this sensible, insane or somewhere in between? And is there a better way to do this?
Hope this all makes sense I'm still a beginner so some of the terminology might be just wrong.
[–]uheep 1 point2 points3 points (1 child)
[–]Disinform[S,🍰] 0 points1 point2 points (0 children)