-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHouseHand.cs
36 lines (31 loc) · 953 Bytes
/
HouseHand.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Text;
namespace BlackjackBacktest
{
public class HouseHand : Hand
{
// the second card dealt is always shown for the dealer's hand
public Card CardShowing
{
get
{
return _cards[1];
}
}
public override void Hit(Dealer dealer)
{
// when the house hits, it will keep hitting till the condition is met
// check for blackjack
if (IsBlackJack || IsBust)
return;
// this doesn't have the logic regarding a 'soft 17', used by some casinos
while (SumCards <= 16)
{
dealer.DealCard(this);
}
// at this point the dealers cards are known, the status is
// set, and the collection is available
}
}
}