public bool Play() { DisplayCard(); if (m_game.IsGameOver()) { m_view.DisplayGameOver(m_game.IsDealerWinner()); } view.Input input = m_view.GetInput(); if (input == view.Input.Play) { m_game.NewGame(); } else if (input == view.Input.Hit) { m_game.Hit(); } else if (input == view.Input.Stand) { m_game.Stand(); } return(input != view.Input.Quit); }
public bool Play() { m_game.AddSubscriber(this); ShowHands(); if (m_game.IsGameOver()) { m_view.DisplayGameOver(m_game.IsDealerWinner()); } view.Input input = m_view.GetInput(); switch (input) { case view.Input.StartNewGame: m_game.NewGame(); break; case view.Input.Stand: m_game.Stand(); break; case view.Input.Hit: m_game.Hit(); break; case view.Input.Quit: return(false); case view.Input.None: break; default: break; } return(true); }