Ejemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var arcanoidMainForm = new ArcanoidMainForm();
            var mainPanel        = new MainPanel();
            var pausePanel       = new PausePanel();
            var gamePanel        = new GamePanel();

            var controlViewsModel = new ControlViewsModel();
            var gameModel         = new GameModel();

            controlViewsModel.AddControl(NameControlEnum.MainForm, arcanoidMainForm);
            controlViewsModel.AddControl(NameControlEnum.GameInterface, gamePanel);
            controlViewsModel.AddControl(NameControlEnum.PauseInterface, pausePanel);
            controlViewsModel.AddControl(NameControlEnum.MainInterface, mainPanel);

            var mainIntefacePresetner   = new MainInterfacePresenter(mainPanel, controlViewsModel, gameModel);
            var pauseInterfacePresenter = new PauseInterfacePresenter(pausePanel, controlViewsModel, gameModel);
            var gameInterfacePresenter  = new GameInterfacePresenter(gamePanel, controlViewsModel, gameModel);

            arcanoidMainForm.Controls.Add(mainPanel);

            Application.Run(arcanoidMainForm);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Добавляет форму в модель
 /// </summary>
 /// <param name="nameAddControl">имя добавляемой формы</param>
 /// <param name="control">ссылка на форму</param>
 protected void AddControlInModel(NameControlEnum nameAddControl, Control control)
 {
     _model.AddControl(nameAddControl, control);
 }