/// <summary> /// /// </summary> /// <param name="mainView">Главный представление для взаимодействия с объектами на сцене.</param> /// <param name="controlController">Контроллер управления</param> /// <param name="gameController">Контроллер основной игровой механики</param> public MainController(IMainView mainView, IControlController controlController, IGameController gameController) { _mainView = mainView; _controlController = controlController; _gameController = gameController; _isStartGame = false; _mainView.OnStartGame += () => _isStartGame = true; _mainView.OnStopnGame += () => { _gameController.StopGame(); _isStartGame = false; }; }
public ButtonController(IControlController control, Point relativePosition) { buttonRectangle = new Rectangle(); buttonRectangle.Width = width; buttonRectangle.Height = height; this.control = control; rectangleProvider = this.control.RectangleProvider; left = relativePosition.X; top = relativePosition.Y; control.TimelineZoomChanged += Timeline_TimelineZoomChanged; control.TimelineLengthChanged += Timeline_TimelineLengthChanged; control.LocationChanged += Control_LocationChanged; rectangleProvider.Paint += RectangleProvider_Paint; rectangleProvider.MouseDown += RectangleProvider_MouseDown; rectangleProvider.MouseUp += RectangleProvider_MouseUp; UpdateCache(); UpdateUI(); }