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


C# Deck.GetTopCard方法代码示例

本文整理汇总了C#中Deck.GetTopCard方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.GetTopCard方法的具体用法?C# Deck.GetTopCard怎么用?C# Deck.GetTopCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Deck的用法示例。


在下文中一共展示了Deck.GetTopCard方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestDeckClass

 private static void TestDeckClass(Random rand)
 {
     Console.WriteLine("# Test Deck class");
     Deck deck = new Deck(rand);
     Console.WriteLine(deck);
     deck.Rotate();
     Console.WriteLine(deck);
     Console.WriteLine(deck.GetTopCard());
     Console.WriteLine(deck.GetTopCard());
     Console.WriteLine(deck.GetTopCard());
 }
开发者ID:davidbedok,项目名称:oeprog1,代码行数:11,代码来源:Program.cs

示例2: Main

        static void Main()
        {
            int graczerundy;
            var random = new Random();
            var tableCards=new List<Card>();
            Console.WriteLine("Podaj ilość graczy :");
            // ReSharper disable once AssignNullToNotNullAttribute
            var playersCount = int.Parse(Console.ReadLine());
            //Console.WriteLine(playersCount);
            if (playersCount>10)
            {
                Console.Clear();
                Console.WriteLine("Za duzo graczy");
                Console.ReadKey();
                return;
            }
            Console.WriteLine("Podaj małą ciemną");
            // ReSharper disable once AssignNullToNotNullAttribute
            var smallBlind = int.Parse(Console.ReadLine());
            Console.WriteLine("Podaj dużą ciemną");
            // ReSharper disable once AssignNullToNotNullAttribute
            var bigBlind = int.Parse(Console.ReadLine());
            Console.WriteLine("Ile rund chcecie grac?");
            // ReSharper disable once AssignNullToNotNullAttribute
            var ilerund = int.Parse(Console.ReadLine());
            var graczeList = new List<BasicPlayer>(playersCount);
            for (var i = 0; i < playersCount; i++)

            {
                var nazwa = "gracz";
                nazwa = nazwa + (i+1);
                graczeList.Add(new BasicPlayer());
                graczeList[i].Name = nazwa;
                Console.WriteLine(nazwa);
            }
            //foreach (var VARIABLE in graczeList)
            //{
            //    Console.WriteLine(VARIABLE.Name);
            //}
            foreach (var gracz in graczeList)
            {
                gracz.Tokens = 100;
            }
            Console.ReadKey();
            Console.Clear();
            Console.WriteLine("Zaczynamy Texas Hold'Em");
            for (int runda = 0; runda < ilerund; runda++)
            {

                Console.WriteLine("Generowanie Tali Kart");
                var talia = new Deck(true);
                //foreach (var karta in talia.GetCards())
                //{
                //    Console.WriteLine(karta.ToString());
                //}
                Console.ReadKey();
                Console.Clear();
                var dealerButton=0;
                if (runda == 0)
                {
                    dealerButton = random.Next(playersCount);
                }
                else dealerButton = MaMalaCiemna(dealerButton, playersCount);
                var mamalaciemna = MaMalaCiemna(dealerButton, playersCount);
                var maduzaciemna = MaDuzaCiemna(dealerButton, playersCount);
                var pula = 0;
                var zaklad = 0;
                Console.WriteLine(graczeList[dealerButton].Name + " Ma dealer button");
                Console.WriteLine(graczeList[mamalaciemna].Name + " Ma mala ciemna");
                Console.WriteLine(graczeList[maduzaciemna].Name + " Ma duza ciemna");
                Console.WriteLine("Rozdanie wstępne");
                foreach (var gracz in graczeList)
                {
                    // Console.WriteLine(gracz.Name);
                    gracz.Hand.Add(talia.GetTopCard());
                    gracz.Hand.Add(talia.GetTopCard());
                }
                //foreach (var gracz in graczeList)
                //{
                //    Console.WriteLine(gracz.Name);
                //    foreach (var karty in gracz.Hand)
                //    {
                //        Console.WriteLine(karty.ToString());
                //    }
                //}
                Console.ReadKey();
                var aktualniPlayers = graczeList;
                var tura = 0;
                //List<BasicPlayer> kolejkaPlayers = kolejnosPlayers(aktualniPlayers, dealerButton);
                //foreach (var players in kolejkaPlayers)
                //{
                //    Console.WriteLine(players.Name);
                //}
                var cioty = new List<BasicPlayer>();
                var zaklady = new int[aktualniPlayers.Count];
                do
                {
                    tura++;
                    // ReSharper disable once SwitchStatementMissingSomeCases
                    bool wybor;
//.........这里部分代码省略.........
开发者ID:Opentany,项目名称:Tech,代码行数:101,代码来源:HotSeats.cs

示例3: newDeckShuffleButton_Click

        /// <summary
        ///     Click event which on click removes current game and shuffles/creates a new one
        ///     Sets the coordinate to 0, enables some buttons which are disabled at games end or before shuffleing.
        ///     
        ///     Also has an if-statment for the show cards up in the pile or down
        /// </summary>
        private void newDeckShuffleButton_Click(object sender, RoutedEventArgs e)
        {
            handGUI1.deleteList();
            xCoordinate = 0.0;
            faceUpCheckBox.IsEnabled = IsEnabled;
            cardGUI1.Visibility = Visibility.Visible;
            drawCardsButton.IsEnabled = IsEnabled;
            acesListBox.Items.Clear();
            newDeck = new Deck();
            newDeck.Shuffle();

            //Gets the topcard and put in first cardcontent
            Card nextCard = newDeck.GetTopCard();
            if (faceUpCheckBox.IsChecked == true)
            {
                cardGUI1.CardImage(nextCard.ImageIndex);
            }

            else
            {
                cardGUI1.CardImage("b1fv.png");
            }
        }
开发者ID:devharis,项目名称:WinForms,代码行数:29,代码来源:MainWindow.xaml.cs


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