Пример #1
0
    public virtual IView Create(ViewTypes type)
    {
        IView view = null;
        switch (type) {
            case ViewTypes.GAME:
                view = new GameView(services.Updateables, services.GameService);
            break;
            case ViewTypes.INIT:
                view = new InitView();
            break;
            case ViewTypes.LOAD:
                view = new LoadView();
            break;
            case ViewTypes.MAIN:
                view = new MainView(services);
                break;
            case ViewTypes.RESULTS:
                view = new ResultsView(services);
                break;
            case ViewTypes.LEVEL_UP:
                view = new LevelUpView(services);
                break;
        }
        initView(view);

        return view;
    }
Пример #2
0
 public LevelUpState(StateMachine stateMachine, PlayerService playerService) : base(stateMachine)
 {
     _playerService = playerService;
     _levelUpModel  = new LevelUpModel();
     _spriteBatch   = new SpriteBatch(StateMachine.Game.GraphicsDevice);
     _view          = new LevelUpView(StateMachine.Game.Content, _spriteBatch, _levelUpModel, _playerService);
     _controller    = new LevelUpController(_levelUpModel, _playerService);
 }
Пример #3
0
        /// <summary>
        /// Shows level up dialog
        /// </summary>
        public LevelModel ShowLevelUpDialog(Dictionary <KeyValuePair <Guid, string>, int> classesMap, int level)
        {
            ModalDialog modalDialog = new ModalDialog();

            if (_parentWindow != null)
            {
                modalDialog.Owner = _parentWindow;
            }

            LevelUpViewModel levelUpViewModel = new LevelUpViewModel(classesMap, level);
            LevelUpView      levelUpView      = new LevelUpView(levelUpViewModel);

            modalDialog.WindowTitle  = "Level Up";
            modalDialog.Body         = levelUpView;
            modalDialog.Confirmation = levelUpView.ViewModel;

            bool?result = ShowDialog(modalDialog);

            return(result == true ? levelUpViewModel.Level.LevelModel : null);
        }