// 1. void StartNewGame() public void StartNewGame() { // 1.1. paņem jaunu kāršu kavu deck = new Deck(); dealer = new Dealer(); player = new Player(); // 1.2. samaisa kārtis deck.shuffle(); // 1.3. spēlētājam piešķir 2 kārtis player.GiveCard(deck.getCard()); player.GiveCard(deck.getCard()); // 1.4. dīlerim piešķir 2 kārtis dealer.GiveCard(deck.getCard()); dealer.GiveCard(deck.getCard()); }
//4.1 dod kartis speletajam tik ilgi, kamer velas //5. void DealerTurn() public void DealerTurn() { while (dealer.NeedCard()) { dealer.GiveCard(deck.GetCard()); } }
// 5. void DealerTurn() public void DealerTurn() { // 5.1 dod kārtis dīlerim tik ilgi, kamēr nepieciešams while (dealer.NeedCard()) { dealer.GiveCard(deck.getCard()); } }
// 1. void Start new game public void StartNewGame() { Console.WriteLine("Bets are closed, good luck: "); //1.1. panjem jaunu karshu kavu deck = new Deck(); dealer = new Dealer(); player = new Player(); // 1.2. samaisa kartis deck.Shuffle(); // 1.3. speletajam pieshkir 2 kartis player.GiveCard(deck.GetCard()); player.GiveCard(deck.GetCard()); // 1.4. dilerim pieshkir 2 kartis dealer.GiveCard(deck.GetCard()); dealer.GiveCard(deck.GetCard()); }