本文整理汇总了C#中BlackJack.model.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于BlackJack.model命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deal
public void Deal(Player a_player, bool show = true)
{
Card c;
c = m_deck.GetCard();
c.Show(show);
a_player.DealCard(c);
}
示例2: DealCard
public void DealCard(Player a_toGetCard, bool a_showCard)
{
var c = m_deck.GetCard();
c.Show(a_showCard);
a_toGetCard.DealCard(c);
Notify();
}
示例3: DealCard
public void DealCard(Player a_player, bool a_show)
{
Card c;
c = m_deck.GetCard();
c.Show(a_show);
a_player.DealCard(c);
}
示例4: NewCard
public void NewCard(Player a_player, bool show)
{
Card c = m_deck.GetCard();
c.Show(show);
a_player.DealCard(c);
UpdateObservers();
}
示例5: DealCard
public void DealCard(bool show, Player a_player)
{
Card c;
c = m_deck.GetCard();
c.Show(show);
a_player.DealCard(c);
}
示例6: StartNewRound
public void StartNewRound(Player a_player)
{
if (m_deck == null)
{
m_deck = new Deck();
m_startGameRule.StartNewRound(a_player, this, m_deck);
}
}
示例7: Game
public Game(AbstractRulesFactory ruleSet)
{
rules = new RulesFactory(ruleSet);
m_dealer = new Dealer(rules);
//m_dealer = new Dealer(new rules.RulesFactory(ruleSet));
m_player = new Player();
PrepareGetRules();
}
示例8: IsDealerWinner
public bool IsDealerWinner(Player a_player)
{
if (m_winRule.DealerWins(a_player.CalcScore(), CalcScore(), m_maxScoreRule.MaxScore()))
{
return true;
}
return false;
}
示例9: IsGameOver
public bool IsGameOver(Player a_player)
{
if (m_deck != null && /*CalcScore() >= g_hitLimit*/ ((m_hitRule.DoHit(this) != true) || a_player.CalcScore() >= 21))
{
return true;
}
return false;
}
示例10: NewGame
public bool NewGame(Player a_player)
{
if (m_deck == null || IsGameOver())
{
m_deck = new Deck();
return m_newGameRule.NewGame(this, a_player);
}
return false;
}
示例11: Hit
public bool Hit(Player a_player)
{
if (m_deck != null && a_player.CalcScore() < g_maxScore && !IsGameOver(a_player))
{
GetAndGiveNewCard(a_player, true);
return true;
}
return false;
}
示例12: Main
static void Main(string[] args)
{
model.Dealer d = new model.Dealer();
model.Player p = new model.Player();
view.Console v = new view.Console();
controller.Player c = new controller.Player();
while (c.PlayGame(v, d, p)) ;
}
示例13: Hit
public bool Hit(Player a_player)
{
if (m_deck != null && a_player.CalcScore() < m_winnerRule.maxScore && !IsGameOver())
{
DealCard(true, a_player);
return true;
}
return false;
}
示例14: HitPlayer
public void HitPlayer(Player a_player)
{
if (m_deck != null && a_player.GetScoreOfHand() < 21)
{
Card c = m_deck.GetCard();
c.Show();
a_player.DealCard(c);
}
}
示例15: Hit
public bool Hit(Player a_player)
{
if (m_deck != null && a_player.CalcScore() < m_maxScoreRule.MaxScore() && !IsGameOver())
{
Deal(a_player, true);
return true;
}
return false;
}