本文整理汇总了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());
}
示例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;
//.........这里部分代码省略.........
示例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");
}
}