本文整理汇总了C#中Dealer类的典型用法代码示例。如果您正苦于以下问题:C# Dealer类的具体用法?C# Dealer怎么用?C# Dealer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dealer类属于命名空间,在下文中一共展示了Dealer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
// Update is called once per frame
void Update()
{
if(FriendlyDealer != null)
{
blockRenderer.material.color = Color.Lerp(Color.white, FriendlyDealer.DealerColor, Respect[FriendlyDealer.ID]);
}
else
{
if (blockRenderer.material.color != Color.white)
blockRenderer.material.color = Color.white;
}
if ((FriendlyDealer != null && Respect.Max(r => r.Value) > Respect[FriendlyDealer.ID]) || (Respect.Any(r => r.Value > 0)))
{
FriendlyDealer = DealerManager.Dealers.First(d => d.ID == Respect.First(re => re.Value == Respect.Max(r => r.Value)).Key);
}
if (inputManager.SelectedNeighborhood == this)
{
transform.position = new Vector3(transform.position.x, 1, transform.position.z);
}
else
{
transform.position = new Vector3(transform.position.x, 0, transform.position.z);
}
}
示例2: NewGame
public bool NewGame(Dealer a_dealer, Player a_player)
{
a_dealer.ShowDealACard(true, a_player);
a_dealer.ShowDealACard(true, null);
a_dealer.ShowDealACard(true, a_player);
return true;
}
示例3: NewGame
public bool NewGame(IDeck a_deck, Dealer a_dealer, Player a_player)
{
//Refactoring. Inherit method from BaseGameStrategy
GetCardAndDeal(a_deck, a_player, true);
GetCardAndDeal(a_deck, a_dealer, true);
GetCardAndDeal(a_deck, a_player, true);
GetCardAndDeal(a_deck, a_dealer, false);
//Card c;
//c = a_deck.GetCard();
//c.Show(true);
//a_player.DealCard(c);
//c = a_deck.GetCard();
//c.Show(true);
//a_dealer.DealCard(c);
//c = a_deck.GetCard();
//c.Show(true);
//a_player.DealCard(c);
//c = a_deck.GetCard();
//c.Show(false);
//a_dealer.DealCard(c);
return true;
}
示例4: NewGame
public bool NewGame(Dealer a_dealer, Player a_player)
{
a_dealer.Deal(a_player, true);
a_dealer.Deal(a_dealer, true);
a_dealer.Deal(a_player, true);
return true;
}
示例5: NewGame
public bool NewGame(Deck a_deck, Dealer a_dealer, Player a_player)
{
a_dealer.NewCard(a_player, true);
a_dealer.NewCard(a_dealer, true);
a_dealer.NewCard(a_player, true);
a_dealer.NewCard(a_dealer, false);
//Card c;
//c = a_deck.GetCard();
//c.Show(true);
//a_player.DealCard(c);
//c = a_deck.GetCard();
//c.Show(true);
//a_dealer.DealCard(c);
//c = a_deck.GetCard();
//c.Show(true);
//a_player.DealCard(c);
return true;
}
示例6: getHighestCardInHand
public Card getHighestCardInHand(IEnumerable<Card> hand, Dealer a_dealer)
{
int[] cardScores = a_dealer.getCardScoreArray();
int Highest = 0;
highestCard = null;
foreach (Card c in hand)
{
if (cardScores[(int)c.GetValue()] >= Highest)
{
Highest = cardScores[(int)c.GetValue()];
if (highestCard == null)
{
highestCard = c;
}
else if (cardScores[(int)c.GetValue()] > cardScores[(int)highestCard.GetValue()])
{
highestCard = c;
}
else if (isHigherCardColorValue(c.GetColor(), highestCard.GetColor()))
{
highestCard = c;
}
}
}
return highestCard;
}
示例7: CheckDealerWins
public void CheckDealerWins()//check if 'face
{
//Arrange
var playerHand = new Dictionary<string, int>();
playerHand.Add("10", 1);
playerHand.Add("5", 2);
var dealerHand = new Dictionary<string, int>();
dealerHand.Add("10", 1);
dealerHand.Add("11", 5);
var player = new Player();
var dealer = new Dealer();
player.PlayerHand = playerHand;
dealer.PlayerHand = dealerHand;
//Act
player.CountedValue();
dealer.CountedValue();
var results = Program.CheckWinner(player, dealer);
//Assert
Assert.AreEqual(Program.Win.Dealer, results);
}
示例8: NewGame
public bool NewGame(Deck aDeck, Dealer aDealer, Player aPlayer)
{
aDealer.NewCard(aDeck, aPlayer);
aDealer.NewCard(aDeck, aDealer);
aDealer.NewCard(aDeck, aPlayer);
return true;
}
示例9: NewGame
public bool NewGame(Deck a_deck, Dealer a_dealer, Player a_player)
{
a_dealer.DrawCardAndShowCard(a_player, true);
a_dealer.DrawCardAndShowCard(a_dealer, true);
a_dealer.DrawCardAndShowCard(a_player, true);
return true;
}
示例10: DoesntDetermineAWinnerIfBothPlayersHasCardsWithEqualRank
public void DoesntDetermineAWinnerIfBothPlayersHasCardsWithEqualRank()
{
var shuffler = new Mock<IShuffler>();
var dealer = new Dealer(shuffler.Object);
var deck = new Deck(new[]
{
Jack.Of(CardSuit.Hearts),
Jack.Of(CardSuit.Spades)
});
shuffler.Setup(a => a.Shuffle(deck)).Returns(new[]
{
Jack.Of(CardSuit.Spades),
Jack.Of(CardSuit.Hearts)
});
dealer.Shuffle(deck);
dealer.DealCards(deck, 2).To(_Players.PlayerOne, _Players.PlayerTwo);
_Players.PlayerOne.RevealsTopCardIn(_Round);
_Players.PlayerTwo.RevealsTopCardIn(_Round);
_Round.DetermineWinner();
Assert.That(_Players.PlayerOne.Hand().IsEmpty());
Assert.That(_Players.PlayerTwo.Hand().IsEmpty());
}
示例11: Deal_ToPlayer_RemovesCardFromDeck
public void Deal_ToPlayer_RemovesCardFromDeck()
{
PokerPlayer player = new PokerPlayer("RobA2345");
Dealer dealer = new Dealer(new Game(), new Deck());
dealer.Deal(player);
Assert.AreEqual(51, dealer.DeckCount);
}
示例12: DetermineAWinnerIfOnePlayerHasBetterCardThanTheOther
public void DetermineAWinnerIfOnePlayerHasBetterCardThanTheOther()
{
var shuffler = new Mock<IShuffler>();
var dealer = new Dealer(shuffler.Object);
var deck = new Deck(new[]
{
King.Of(CardSuit.Hearts),
Jack.Of(CardSuit.Spades)
});
shuffler.Setup(a => a.Shuffle(deck)).Returns(new[]
{
Jack.Of(CardSuit.Spades),
King.Of(CardSuit.Hearts)
});
dealer.Shuffle(deck);
dealer.DealCards(deck, 2).To(_Players.PlayerOne, _Players.PlayerTwo);
_Players.PlayerOne.RevealsTopCardIn(_Round);
_Players.PlayerTwo.RevealsTopCardIn(_Round);
_Round.DetermineWinner();
Assert.That(_Players.PlayerOne.Hand().IsEmpty());
Assert.That(_Players.PlayerTwo.Hand().Count, Is.EqualTo(2));
}
示例13: DealerClick
public void DealerClick(object sender, RoutedEventArgs e)
{
Dealer view = new Dealer();
DealerViewModel viewModel = new DealerViewModel();
view.DataContext = viewModel;
view.ShowDialog();
}
示例14: CalcWinner
public bool CalcWinner(Player a_player, Dealer a_dealer)
{
int[] cardScores = a_dealer.getCardScoreArray();
IEnumerable<Card> pHand = a_player.GetHand();
IEnumerable<Card> dHand = a_dealer.GetHand();
Card PlayerHighest = getHighestCardInHand(pHand, a_dealer);
Card DealerHighest = getHighestCardInHand(dHand, a_dealer);
if (cardScores[(int)PlayerHighest.GetValue()] == cardScores[(int)DealerHighest.GetValue()])
{
//if the second parameter is higher value then false is returned, aka player win.
return isHigherCardColorValue(DealerHighest.GetColor(), PlayerHighest.GetColor());
}
if (cardScores[(int)PlayerHighest.GetValue()] > cardScores[(int)DealerHighest.GetValue()])
{
//player won
return false;
}
else
{
//dealer won.
return true;
}
}
示例15: NewGame
public bool NewGame(Dealer a_dealer, Player a_player) //Deck a_deck,
{
a_dealer.GetNewCard(a_player, true);
a_dealer.GetNewCard(a_dealer, true);
a_dealer.GetNewCard(a_player, true);
return true;
}
开发者ID:mc22ft,项目名称:Objektorienterad-analys-och-design-med-UML,代码行数:8,代码来源:InternationalNewGameStrategy.cs