I'm trying to create a PC version of a cord-driven turn-based boardgame. I went for the Monogame framework in c#. I'm still learning C# and Monogame and I'm reading all about how it is important to "split" the code in the data/game engine part and the graphics/GUI part. So trying to pursue this, I have the following in mind.
Graphics/GUI
Here I define all the classes relative to the screens (game - menus), GUI components like labels and buttons and possibly even mouse and keyboard inputs (the logic being the user has to click on something in the gui in order to perform an action).
Data or Game logic/Engine
Still not even sure on how I should call this part of the project, here I would put all the logic of the game. The classes of player, cards, "IA", rules etc... would be defined here.
My difficulty is now to understand how to connect this two parts but still maintain the "loosely coupled" approach. I was thinking that maybe the objects or better the instances of the game logic part would have to subscribe to events (such as button_click) defined in the GUI part...but can I even subscribe to events of another class? Is this the correct way?
I admit I'm still trying to fully understand the event driven concept, but is this the right way of doing stuff in c# and Monogame? I apologize for the vague topic/question but thanks in advance.