本文整理汇总了C#中Dealer.AddCard方法的典型用法代码示例。如果您正苦于以下问题:C# Dealer.AddCard方法的具体用法?C# Dealer.AddCard怎么用?C# Dealer.AddCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dealer
的用法示例。
在下文中一共展示了Dealer.AddCard方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test5CardsUnder21Win
public void Test5CardsUnder21Win()
{
Player player = new Player();
Deck deck = new Deck();
Dealer dealer = new Dealer();
player.AddCard(new Card(Rank.TWO, Suit.DIAMOND));
player.AddCard(new Card(Rank.TWO, Suit.SPADE));
player.AddCard(new Card(Rank.ACE, Suit.SPADE));
player.AddCard(new Card(Rank.FOUR, Suit.SPADE));
player.AddCard(new Card(Rank.ACE, Suit.HEART));
dealer.AddCard(new Card(Rank.TEN, Suit.HEART));
dealer.AddCard(new Card(Rank.TEN, Suit.SPADE));
BlackJackGame game = new BlackJackGame(deck, player, dealer);
game.CheckScores();
Assert.IsTrue(game.Status == GameState.WIN);
}
示例2: TestBetLose
public void TestBetLose()
{
Player player = new Player();
Deck deck = new Deck();
Dealer dealer = new Dealer();
BlackJackGame game = new BlackJackGame(deck, player, dealer);
player.AddCard(new Card(Rank.TEN, Suit.DIAMOND));
player.AddCard(new Card(Rank.FOUR, Suit.SPADE));
dealer.AddCard(new Card(Rank.TEN, Suit.HEART));
dealer.AddCard(new Card(Rank.EIGHT, Suit.SPADE));
game.Decision = true;
game.CheckScores();
game.RestartGame ();
Assert.IsTrue(game.Player.Money == 80);
}
示例3: TestWin21
public void TestWin21()
{
Player player = new Player();
Deck deck = new Deck();
Dealer dealer = new Dealer();
BlackJackGame game = new BlackJackGame(deck, player, dealer);
dealer.AddCard(new Card(Rank.TEN, Suit.HEART));
dealer.AddCard(new Card(Rank.EIGHT, Suit.SPADE));
player.AddCard(new Card(Rank.ACE, Suit.DIAMOND));
player.AddCard(new Card(Rank.JACK, Suit.SPADE));
game.CheckScores();
game.RestartGame();
Assert.AreEqual(105, game.Player.Money);
}
示例4: TestDealer17
public void TestDealer17()
{
Deck deck = new Deck();
Dealer dealer = new Dealer();
dealer.AddCard(new Card(Rank.KING, Suit.HEART));
dealer.AddCard(new Card(Rank.SEVEN, Suit.CLUB));
dealer.Deal(deck);
Assert.IsTrue (dealer.CardsinHand == 2);
}
示例5: TestWin
public void TestWin()
{
Player player = new Player();
Dealer dealer = new Dealer();
Deck deck = new Deck();
player.AddCard(new Card(Rank.TEN, Suit.DIAMOND));
player.AddCard(new Card(Rank.TEN, Suit.SPADE));
dealer.AddCard(new Card(Rank.TEN, Suit.CLUB));
dealer.AddCard(new Card(Rank.NINE, Suit.SPADE));
BlackJackGame game = new BlackJackGame(deck, player, dealer);
game.Decision = true;
game.CheckScores();
Assert.IsTrue(game.Status == GameState.WIN);
}