   MVC pattern?
  Hey, i was wondering if what i'm doing is close to a MVC Pattern.I have the following classes:Model:Game.cs; in this main form the game itself is rendered + the extra GUI elements like Inventory.cs, CharacterStats.cs etc.Control:GUIHanlder.cs; This handles the GUI elements. Like if a button is pressed in CharacterStats.cs, then it gets handled in GUIHandler.csViews:[i/These are the GUI files (User Controls) that can be Shown (Show()) or Hidden (Hide()) on the main form Game.csInventory.csCharacterStats.csSkills.csMy Question:------------Now what i want to know is, how to implement it properly. Should Game.cs pass an instance of itself to GUIHandler.cs?And should GUIHandler.cs create an instance to all the GUI elements? So i could do the following:(some pseudo code)Game.cs:GUIHandler GUI = new GUIHandler();GUI.ShowCharacterStats();---------------------------------------------GUIHanlder.csGame game;//.ctorGUIHandler(Game game){    this.game = game;    CharacterStats cStats = new CharacterStats();    cStats = new Point(200,300);    game.Controls.Add(cStats);    //Same goes for all the other View classes!!    Iventory invent = new CharacterStats();    invent = new Point(200,300);    ...etc    ...etc}public void ShowInventory(){    invent.Show();}pulbic void btCharStats_CraftStats(){   //Code to update the View to display the users current Crafting status.}Or is better that Game.cs creates an instance to the Views it needs instead of doing that in GUIHandler?So that i just keep GUIHanlder for the button presses that occure on the forms of the Views?   
  Iirc, the MVC pattern is implemented at a lower level, for example, with a single control item like a button or a set of controls like a toolbar with an edit window. "Game" seems to me like a higher level abstraction, a container that holds many other patterns.   ;Quote:Original post by w00Model:Game.cs; in this main form the game itself is rendered + the extra GUI elements like Inventory.cs, CharacterStats.cs etc.If it has gui elements then it isn't the model.  The model should be all game world entities and only game world entities.  The model should the run game and provide a way for the view to know the state of the game. If the model depends on a view or a controller you have done MVC incorrectly.   ;Quote:Original post by stonemetalQuote:Original post by w00Model:Game.cs; in this main form the game itself is rendered + the extra GUI elements like Inventory.cs, CharacterStats.cs etc.If it has gui elements then it isn't the model.  The model should be all game world entities and only game world entities.  The model should the run game and provide a way for the view to know the state of the game. If the model depends on a view or a controller you have done MVC incorrectly.This. The model is simply the state of the game world, the view is, as the name implies, what lets the player know things about the game world (all rendering and sound goes here) and the controller is what lets the player interact with the game world.The player will talk to the controller who will update the model accordingly, which is then presented to the player through the view.   