public bool Play() { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } view.InputEvents input = a_view.GetInput(); if (input == view.InputEvents.NewGame) { a_game.NewGame(); } else if (input == view.InputEvents.Hit) { a_game.Hit(); } else if (input == view.InputEvents.Stand) { a_game.Stand(); } return(input != view.InputEvents.Quit); }
public bool Play() { 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.Alternatives input = (view.Alternatives)m_view.GetInput(); switch (input) { case view.Alternatives.play: m_game.NewGame(); break; case view.Alternatives.hit: m_game.Hit(); break; case view.Alternatives.stand: m_game.Stand(); break; default: break; } return(input != view.Alternatives.quit); }
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 void CardRecieved() { Thread.Sleep(1000); view.DisplayWelcomeMessage(); view.DisplayDealerHand(game.GetDealerHand(), game.GetDealerScore()); view.DisplayPlayerHand(game.GetPlayerHand(), game.GetPlayerScore()); }
public void DisplayGame() { PauseGame(); a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); }
public void RenderGame() { m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public bool Play(model.Game a_game, view.IView a_view) { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } BlackJack.view.MenuEvent.Event e; e = a_view.GetEvent(); if (e == BlackJack.view.MenuEvent.Event.Quit) { return(false); } if (e == BlackJack.view.MenuEvent.Event.Start) { a_game.NewGame(); } if (e == BlackJack.view.MenuEvent.Event.Hit) { a_game.Hit(); } if (e == BlackJack.view.MenuEvent.Event.Stand) { a_game.Stand(); } return(true); }
public bool Play() { 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()); } Event input = m_view.GetInput(); switch (input) { case Event.Play: m_game.NewGame(); break; case Event.Hit: m_game.Hit(); break; case Event.Stand: m_game.Stand(); break; } return(input != Event.Quit); }
public void DisplayAllScreen() { m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public void CardDrawn() { System.Threading.Thread.Sleep(500); a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); }
public bool Play(model.Game a_game, view.IView a_view) { m_view = a_view; m_game = a_game; m_view.DisplayWelcomeMessage(); m_game.AddSubToPlayer(this); 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.MenuOptions input = m_view.GetInput(); if (view.MenuOptions.PLAY.Equals(input)) { m_game.NewGame(); } else if (view.MenuOptions.HIT.Equals(input)) { m_game.Hit(); } else if (view.MenuOptions.STAND.Equals(input)) { m_game.Stand(); } return(!view.MenuOptions.QUIT.Equals(input)); }
public bool Play(model.Game a_game, view.IView a_view) { m_game = a_game; m_view = a_view; a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } int input = a_view.GetInput(); if (input == (int)GameAlternative.Play) { a_game.NewGame(); } else if (input == (int)GameAlternative.Hit) { a_game.Hit(); } else if (input == (int)GameAlternative.Stand) { a_game.Stand(); } return(input != (int)GameAlternative.Quit); }
public bool Play(model.Game a_game, view.IView a_view) { a_game.AddSubscriberToPlayer(this); a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } model.MenuChoice choice = a_view.GetMenuChoice(); if (choice == model.MenuChoice.NewGame) { a_game.NewGame(); } else if (choice == model.MenuChoice.Hit) { a_game.Hit(); } else if (choice == model.MenuChoice.Stand) { a_game.Stand(); } return(choice != model.MenuChoice.Quit); }
public bool Play(model.Game a_game, view.IView a_view) { this.m_view = a_view; this.m_view.DisplayWelcomeMessage(); this.m_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); this.m_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { this.m_view.DisplayGameOver(a_game.IsDealerWinner()); } int input = this.m_view.GetInput(); if (input == BlackJack.view.SwedishView.Play) { a_game.NewGame(); } else if (input == BlackJack.view.SwedishView.Hit) { a_game.Hit(); } else if (input == BlackJack.view.SwedishView.Stand) { a_game.Stand(); } return(input != BlackJack.view.SwedishView.Quit); }
public void DisplayMessages(model.Game a_game, view.IView a_view) { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); }
public bool Play(model.Game a_game, view.IView a_view) { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } int input = a_view.GetInput(); if (a_view.PlayerWantsToPlay(input)) { a_game.NewGame(); } else if (a_view.PlayerWantsToHit(input)) { a_game.Hit(); } else if (a_view.PlayerWantsToStand(input)) { a_game.Stand(); } return(a_view.PlayerWantsToQuit(input)); }
private void DisplayInfo() { m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public bool Play() { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } int input = a_view.GetInput(); if (a_view.IsPlay(input)) { a_game.NewGame(); } else if (a_view.IsHit(input)) { a_game.Hit(); } else if (a_view.IsStand(input)) { a_game.Stand(); } return(!a_view.IsQuit(input)); }
public bool Play() { bool keepPlaying = true; a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } Enum input = a_view.GetInput(); if (input != null) { switch (input) { case ViewEnums.Play: a_game.NewGame(); break; case ViewEnums.Hit: a_game.Hit(); break; case ViewEnums.Stand: a_game.Stand(); break; case ViewEnums.Quit: keepPlaying = false; break; default: break; } } return(keepPlaying); }
public void m_dealer_HandCardCompleted(object sender, EventArgs e) { Thread.Sleep(2000); view.DisplayWelcomeMessage(); view.DisplayDealerHand(game.GetDealerHand(), game.GetDealerScore()); view.DisplayPlayerHand(game.GetPlayerHand(), game.GetPlayerScore()); }
public bool Play(model.Game a_game, view.IView a_view) { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } int input = a_view.GetInput(); if (input == 'p') { a_game.NewGame(); } else if (input == 'h') { a_game.Hit(); Observer pause = new Observer(); pause.PauseIt(); } else if (input == 's') { a_game.Stand(); } return(input != 'q'); }
public void CardDealt() { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); a_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); a_view.PauseRedraw(); }
public bool Play(model.Game a_game, view.IView a_view) { a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); if (a_game.IsGameOver()) { a_view.DisplayGameOver(a_game.IsDealerWinner()); } view.MenuSelection input = a_view.GetInput(); if (input == view.MenuSelection.Play) { a_game.NewGame(); } else if (input == view.MenuSelection.Hit) { a_game.Hit(); } else if (input == view.MenuSelection.Stand) { a_game.Stand(); } return(input != view.MenuSelection.Quit); }
public void DealtCard() { Thread.Sleep(2000); //Wait for two seconds m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public void HandleEvent(object sender, EventArgs args) { System.Threading.Thread.Sleep(1000); Console.Clear(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public void CardDealt() { m_view.Pause(1000); m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); m_view.Pause(1000); }
public void DisplayCards() { System.Threading.Thread.Sleep(1000); m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand(m_game.GetDealerHand(), m_game.GetDealerScore()); m_view.DisplayPlayerHand(m_game.GetPlayerHand(), m_game.GetPlayerScore()); }
public void UpdateCards() { Thread.Sleep(1000); a_view.DisplayWelcomeMessage(); a_view.DisplayDealerHand(a_game.GetDealerHand(), a_game.GetDealerScore()); a_view.DisplayPlayerHand(a_game.GetPlayerHand(), a_game.GetPlayerScore()); }
private void Display() { 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()); } }
public void NotifyAboutDealtCard() { m_view.DisplayWelcomeMessage(); m_view.DisplayDealerHand( m_game.GetDealerHand(), m_game.GetDealerScore() ); m_view.DisplayPlayerHand( m_game.GetPlayerHand(), m_game.GetPlayerScore() ); m_view.PauseDramatically(); }