当前位置: 首页>>代码示例>>C#>>正文


C# Dealer类代码示例

本文整理汇总了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);
        }
    }
开发者ID:Calebsem,项目名称:LordOfWarLD33,代码行数:26,代码来源:Neighborhood.cs

示例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;
 }
开发者ID:rs222kn,项目名称:1DV607,代码行数:7,代码来源:InternationalNewGameStrategy.cs

示例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;
        }
开发者ID:henceee,项目名称:1DV607-1,代码行数:28,代码来源:AmericanNewGameStrategy.cs

示例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;
 }
开发者ID:DevRobDev,项目名称:1DV407,代码行数:7,代码来源:InternationalNewGameStrategy.cs

示例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;
        }
开发者ID:la222tc,项目名称:blackjack_csharp,代码行数:26,代码来源:InternationalNewGameStrategy.cs

示例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;
        }
开发者ID:MartinArvidsson,项目名称:UML,代码行数:29,代码来源:Highestcardrule.cs

示例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);

        }
开发者ID:Sakthipriya123,项目名称:NewsTracker,代码行数:29,代码来源:BlackJackTest.cs

示例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;
 }
开发者ID:ej222ru,项目名称:1DV607_WS3,代码行数:7,代码来源:InternationalNewGameStrategy.cs

示例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;
 }
开发者ID:Marco30,项目名称:1DV607-Workshops,代码行数:7,代码来源:InternationalNewGameStrategy.cs

示例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());
        }
开发者ID:tekavec,项目名称:WarGameKata,代码行数:25,代码来源:RoundShould.cs

示例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);
 }
开发者ID:GrimeyCoder,项目名称:CommonGames,代码行数:7,代码来源:DealerTests.cs

示例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));
        }
开发者ID:tekavec,项目名称:WarGameKata,代码行数:25,代码来源:RoundShould.cs

示例13: DealerClick

 public void DealerClick(object sender, RoutedEventArgs e)
 {
     Dealer view = new Dealer();
     DealerViewModel viewModel = new DealerViewModel();
     view.DataContext = viewModel;
     view.ShowDialog();
 }
开发者ID:Cecosam,项目名称:Csharp-Projects,代码行数:7,代码来源:WelcomeScreen.xaml.cs

示例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;
            }
        }
开发者ID:MartinArvidsson,项目名称:UML,代码行数:26,代码来源:Highestcardrule.cs

示例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


注:本文中的Dealer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。