本文整理汇总了C#中IPlayer.increase_pot_by方法的典型用法代码示例。如果您正苦于以下问题:C# IPlayer.increase_pot_by方法的具体用法?C# IPlayer.increase_pot_by怎么用?C# IPlayer.increase_pot_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlayer
的用法示例。
在下文中一共展示了IPlayer.increase_pot_by方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: determine_winner_from
public void determine_winner_from(IPlayingPositions playing_positions, IPlayer player)
{
var dealers_hand = playing_positions.dealers_hand;
dealers_hand.show_card_in_hole();
foreach (var players_hand in playing_positions.players_hands())
{
if (players_hand.has_status_of(HandStatus.blackjack) && dealers_hand.has_status_of(HandStatus.blackjack))
{
players_hand.change_state_to(HandStatus.push);
}
else if (players_hand.has_status_of(HandStatus.blackjack))
{
players_hand.change_state_to(HandStatus.won);
}
else if (dealers_hand.has_status_of(HandStatus.blackjack))
{
players_hand.change_state_to(HandStatus.lost);
}
else if (players_hand.has_status_of(HandStatus.soft_blackjack) &&
dealers_hand.has_status_of(HandStatus.soft_blackjack))
{
players_hand.change_state_to(HandStatus.push);
}
else if (players_hand.has_status_of(HandStatus.soft_blackjack))
{
players_hand.change_state_to(HandStatus.won);
}
else if (dealers_hand.has_status_of(HandStatus.soft_blackjack))
{
players_hand.change_state_to(HandStatus.lost);
}
else if (players_hand.has_status_of(HandStatus.bust) && dealers_hand.has_status_of(HandStatus.bust))
{
players_hand.change_state_to(HandStatus.push);
}
else if (players_hand.has_status_of(HandStatus.bust))
{
players_hand.change_state_to(HandStatus.lost);
}
else if (dealers_hand.has_status_of(HandStatus.bust))
{
players_hand.change_state_to(HandStatus.won);
}
else if (players_hand.has_status_of(HandStatus.stick))
{
var player_score = _hand_scorer.calculate_score_for(players_hand);
var dealers_score = _hand_scorer.calculate_score_for(dealers_hand);
if (player_score > dealers_score)
{
players_hand.change_state_to(HandStatus.won);
}
else if (player_score < dealers_score)
{
players_hand.change_state_to(HandStatus.lost);
}
else if (player_score == dealers_score)
{
players_hand.change_state_to(HandStatus.push);
}
}
var chips_to_give_to_player = new Chips(0m);
// Check if dealer has blackjack and that player took insurnace
if (players_hand.has_taken_insurance() && dealers_hand.has_status_of(HandStatus.blackjack))
{
var original_insurance_amount = players_hand.wager.halved();
var winnings = original_insurance_amount.mulitple_by_odds_of(2, 1);
chips_to_give_to_player = chips_to_give_to_player.add(original_insurance_amount.add(winnings));
}
if (players_hand.has_status_of(HandStatus.won))
{
chips_to_give_to_player = chips_to_give_to_player.add(players_hand.wager.mulitple_by_odds_of(3, 2).add(players_hand.wager));
DomainEvents.raise(new HandResultEvent(string.Format("Hand {0} Won - you win {1}", players_hand.get_hand_letter(), chips_to_give_to_player.ToString())));
player.increase_pot_by(chips_to_give_to_player);
}
if (players_hand.has_status_of(HandStatus.push))
{
chips_to_give_to_player = chips_to_give_to_player.add(players_hand.wager);
player.increase_pot_by(chips_to_give_to_player);
DomainEvents.raise(new HandResultEvent(string.Format("Hand {0} tied with the dealer, you get {1}", players_hand.get_hand_letter(), chips_to_give_to_player.ToString())));
}
if (players_hand.has_status_of(HandStatus.lost))
{
if (chips_to_give_to_player.contains_chips())
{
player.increase_pot_by(chips_to_give_to_player);
DomainEvents.raise(new HandResultEvent(string.Format("Hand {0} lost, but you won insurance bet of {1}", players_hand.get_hand_letter(), chips_to_give_to_player.ToString())));
}
else
{
//.........这里部分代码省略.........