Ejemplo n.º 1
0
/*--------------------------------------------------------------------
*                           METHODS
*  --------------------------------------------------------------------*/

/***********************************************************
*
*   Method:
*       ms_controller
*
*   Description:
*       Constructor.
*
***********************************************************/

        public ms_controller
        (
            ms_game model
        )
        {
            ms_model = model;
        } /* ms_controller() */
Ejemplo n.º 2
0
        } /* draw_header() */

/***********************************************************
*
*   Method:
*       Game1
*
*   Description:
*       Constructor.
*
***********************************************************/

        public Game1(ms_game model, ms_controller ctlr)
        {
/*----------------------------------------------------------
*  Initialize graphics
*  ----------------------------------------------------------*/
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            dims      = new ms_gui_dimension();
            mouse     = new ms_mouse_state();
            toolbar   = new toolbar_type();
            game_menu = new menu_type("Game");

            game_menu.add_item("New Game", new_game_same);
            game_menu.add_item("Beginner", new_game_beginner);
            game_menu.add_item("Intermediate", new_game_intermediate);
            game_menu.add_item("Expert", new_game_expert);
            game_menu.add_item("Exit", Exit);

/*----------------------------------------------------------
*  Save the game model and controller
*  ----------------------------------------------------------*/
            ms_model = model;
            ms_ctlr  = ctlr;

/*----------------------------------------------------------
*  Start new game
*  ----------------------------------------------------------*/
            new_game(9, 9, 10);
        } /* Game1() */
Ejemplo n.º 3
0
        static void Main()
        {
            ms_model = new ms_game();
            ms_ctlr  = new ms_controller(ms_model);

            using (Game1 game = new Game1(ms_model, ms_ctlr))
            {
                game.Run();
            }
        } /* Main() */