コード例 #1
0
ファイル: PlayGame.cs プロジェクト: AndreasAnemyrLNU/1dv607
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            this.a_game = a_game;
            this.m_view = a_view;

            a_game.AddSubscriber(this);
        }
コード例 #2
0
        public bool Play()
        {
            if (subcriberNeeded)
            {
                m_game.AddSubscriber(this);
                subcriberNeeded = false;
            }

            m_view.DisplayWelcomeMessage();

            m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore());
            m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore());

            if (m_game.IsGameOver())
            {
                m_view.DisplayGameOver(m_game.IsDealerWinner());
            }

            view.GameOption input = m_view.GetInput();

            if (input == view.GameOption.Play)
            {
                m_game.NewGame();
            }
            else if (input == view.GameOption.Hit)
            {
                m_game.Hit();
            }
            else if (input == view.GameOption.Stand)
            {
                m_game.Stand();
            }

            return(input != view.GameOption.Quit);
        }
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            m_game = a_game;
            m_view = a_view;

            //subscribe to game events
            m_game.AddSubscriber(this);

            UpdateView();
        }
コード例 #4
0
ファイル: PlayGame.cs プロジェクト: ej222ru/1DV607_WS3
        public PlayGame()
        {
            // create a setup controller
            SetupGame setup = new SetupGame();

            // create a game with config delivered from the setup controller
            m_game = new model.Game(setup.GetWinnerAtDrawRules(), setup.GetDealer17Rules(), setup.GetGameRules());
            // Let setup controller create the game view depending on language
            m_view = setup.GetLanguageView();

            m_game.AddSubscriber(this);
        }
コード例 #5
0
        public PlayGame()
        {
            // create a setup controller
            SetupGame setup = new SetupGame();

            // create a game with config delivered from the setup controller
            m_game = new model.Game(setup.GetWinnerAtDrawRules(), setup.GetDealer17Rules(), setup.GetGameRules());
            // Let setup controller create the game view depending on language
            m_view = setup.GetLanguageView();

            m_game.AddSubscriber(this);
        }
        public PlayGame(model.Game a_game, view.IView a_view)
        {
            m_game = a_game;
            m_view = a_view;

            //subscribe to game events
            m_game.AddSubscriber(this);

            if (!(m_view is view.ModernView))
            {
                ClearView();
            }
        }
コード例 #7
0
 public PlayGame(model.Game a_game, view.IView a_view)
 {
     this.a_game = a_game;
     this.a_view = a_view;
     a_game.AddSubscriber(this);
 }
コード例 #8
0
ファイル: PlayGame.cs プロジェクト: ulricaskarin/1dv607_ws3-1
 public PlayGame(model.Game g, IView v)
 {
     m_game = g;
     m_view = v;
     m_game.AddSubscriber(this);
 }
コード例 #9
0
ファイル: PlayGame.cs プロジェクト: jt222ic/1DV607-Workshops
 public PlayGame(view.IView m_view, model.Game a_game)
 {
     a_view = m_view;
     a_game.AddSubscriber(this);
 }
コード例 #10
0
ファイル: PlayGame.cs プロジェクト: onlylonely1986/WS3
 public PlayGame(view.IView a_view, model.Game a_game)
 {
     m_view = a_view;
     m_game = a_game;
     a_game.AddSubscriber(this);
 }