本文整理汇总了C#中CardSuit.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CardSuit.ToString方法的具体用法?C# CardSuit.ToString怎么用?C# CardSuit.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CardSuit
的用法示例。
在下文中一共展示了CardSuit.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeloteCard
public BeloteCard(CardSuit Suit, CardType Type, bool IsHide, float X, float Y,
BeloteFormAction onTouchStart, BeloteFormAction onTouchEnd)
: this(Suit.ToString () + ((int)Type).ToString ())
{
this.Suit = Suit;
this.Type = Type;
this.IsHide = IsHide;
this.Width = 105;
this.Height = 147;
this.X = X;
this.Y = Y;
this.OnTouchEnd = onTouchEnd;
this.OnTouchStart = onTouchStart;
backTexture = SKTexture.FromImageNamed ("Textures/Cards/back.png");
cardTexture = SKTexture.FromImageNamed ("Textures/Cards/" + Helpers.SuitToString(Suit) + "/" + ((int)Type).ToString () + ".png");
ConstructControl ();
}
示例2: Create
public static PlayingCard Create(CardValue val, CardSuit suit)
{
return new PlayingCard { Suit = suit.ToString(), Value = val.ToString() };
}
示例3: ToString
public static string ToString(CardType type, CardSuit suit)
{
int t = (int)type;
if (t < 10)
return t.ToString() + suit.ToString();
else
return type.ToString() + suit.ToString();
}
示例4: ShowWildcardDialog
private void ShowWildcardDialog(CardSuit overrideSuit)
{
if( this.InvokeRequired )
{
this.Invoke( new ShowWildcardDelegate(ShowWildcardDialog), overrideSuit);
}
else
{
MessageBox.Show(this, string.Format(Properties.Resources.Caption_OverrideSuit, overrideSuit.ToString()), Properties.Resources.Caption_CrazyEights);
}
}
示例5: AdvancePhase
public void AdvancePhase(int phaseOverride = -1)
{
int player1Sum, player2Sum, difference, cardCount;
if (phaseOverride != -1) {
phase = phaseOverride;
} else if (phase == 5) {
phase = 0;
} else {
phase++;
}
if (phase == 0) {
RefillHands ();
SetupNewTurn ();
currentActiveSuit = CommonUtils.RandomSuit();
CheckPlayersForPowerUse();
Debug.Log ("Current Suit: " + currentActiveSuit.ToString ());
Debug.Log ("Phase 0: Player and AI Hands Set Up");
currentActivePlayerForInput = 1;
GetNextPlayerHand();
} else if (phase == 1) {
Debug.Log ("Phase 1: Player and AI Initiative Cards Selected");
AdvancePhase ();
} else if (phase == 2) {
player1Sum = 0;
cardCount = 0;
foreach (Card card in player1SelectedCardList.CardList ()) {
player1Sum += CommonUtils.SuitAdjustedValue(currentActiveSuit, card);
cardCount++;
player1.Hand ().RemoveCard (card);
}
if (player2.IsAI ()) {
player2.ProcessInitiativePhaseResult(cardCount, player1Sum);
}
player1LastHandScore = player1Sum;
SetPlayer1SelectedCardList(player1SelectedCardList.CardList());
player2Sum = 0;
cardCount = 0;
foreach (Card card in player2SelectedCardList.CardList ()) {
player2Sum += CommonUtils.SuitAdjustedValue(currentActiveSuit, card);
cardCount++;
player2.Hand ().RemoveCard (card);
}
if (player1.IsAI ()) {
player1.ProcessInitiativePhaseResult(cardCount, player2Sum);
}
player2LastHandScore = player2Sum;
SetPlayer2SelectedCardList(player2SelectedCardList.CardList());
ClearSelectedCardsList();
if (reflectStatus%2 == 1) {
// @BUGFIX
Debug.Log ("Reflect activated, scores swapped");
int temp = player1Sum;
player1Sum = player2Sum;
player2Sum = temp;
player1LastHandScore = player1Sum;
player2LastHandScore = player2Sum;
}
reflectStatus = 0;
if (player1Sum > player2Sum) {
initiativeWinner = player1;
if (player1.IsAI ()) {
player1.ProcessInitiativePhaseOutcome(true);
}
if (player2.IsAI ()) {
player2.ProcessInitiativePhaseOutcome(false);
}
Debug.Log ("Phase 2: Initiative Phase Result: " + Player1HandScore() + "-" + Player2HandScore() + ": Initiative won by " + InitiativeWinner ().Name ());
} else if (player2Sum > player1Sum) {
initiativeWinner = player2;
if (player1.IsAI ()) {
player1.ProcessInitiativePhaseOutcome(false);
}
if (player2.IsAI ()) {
player2.ProcessInitiativePhaseOutcome(true);
}
Debug.Log ("Phase 2: Initiative Phase Result: " + Player1HandScore() + "-" + Player2HandScore() + ": Initiative won by " + InitiativeWinner ().Name ());
} else {
initiativeWinner = null;
Debug.Log ("Phase 2: Initiative Phase Result: Initiative Phase Tied, Returning to Phase 0");
GrowCards();
RefillHands ();
AdvancePhase (0);
}
if (initiativeWinner == player1) {
player1.AddSuperBar(superBarGainOnInitiativeWin);
Debug.Log (player1.Name () + " gains " + superBarGainOnInitiativeWin + " super for winning initiative");
} else if (initiativeWinner == player2) {
//.........这里部分代码省略.........