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


C# Card.GetSuit方法代码示例

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


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

示例1: Images

        /// <summary>
        /// Constructor - Loads images from disk files.
        /// </summary>
        static Images()
        {
            // Load card images.
            backOfCardImage = Images.LoadImage("Cards", "CardBack_Red");
            cardImages = new Bitmap[CardPile.NUM_SUITS, CardPile.NUM_CARDS_PER_SUIT];

            for (Suit suit = Suit.Clubs; suit <= Suit.Spades; suit++) {
                for (FaceValue faceValue = FaceValue.Two; faceValue <= FaceValue.Ace; faceValue++) {
                    Card card = new Card(suit, faceValue);
                    string cardImageName = GetCardImageName(card);
                    cardImages[(int) card.GetSuit(), (int) card.GetFaceValue()] = LoadImage("Cards", cardImageName); //
                }
            } //end for(Suit suit ...
        }
开发者ID:Lavinia01,项目名称:Solitaire---Crazy-Eights-Game,代码行数:17,代码来源:Images.cs

示例2: HasSameSuit

	public bool HasSameSuit(Card another) {
		return suit == another.GetSuit();
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:3,代码来源:Card.cs

示例3: ValidateSelection

 /// <summary>
 /// It validates the move of the previous code.
 /// </summary>
 /// <param name="card"></param>
 /// <returns>Return true if the card equals the current in its suit, facevalue or its facevalue is eight. Otherwise returns false.</returns>
 private static Boolean ValidateSelection(Card card)
 {
     if (current.GetFaceValue() == FaceValue.Eight && start)
     {
         start = false;
         return true;
     }
     else if (card.GetSuit() == current.GetSuit())
     {
         return true;
     }
     else if (card.GetFaceValue() == current.GetFaceValue())
     {
         return true;
     }
     else if (card.GetFaceValue() == FaceValue.Eight)
     {
         return true;
     }
     start = false;
     return false;
 }
开发者ID:Lavinia01,项目名称:Solitaire---Crazy-Eights-Game,代码行数:27,代码来源:Crazy+Eight+Game.cs

示例4: GetCardImageName

 /// <summary>
 /// Used by the constructor in this class only.  Do NOT use elsewhere.
 /// </summary>
 private static string GetCardImageName(Card card)
 {
     Suit suit = card.GetSuit();
     FaceValue faceValue = card.GetFaceValue();
     return string.Format("{0}{1}", suit.ToString().TrimEnd('s'), faceValue);
 }
开发者ID:Lavinia01,项目名称:Solitaire---Crazy-Eights-Game,代码行数:9,代码来源:Images.cs

示例5: GetCardImage

 /// <summary>
 /// Returns the image for a given Card.
 /// </summary>
 /// <param name="card"></param>
 /// <returns>the image for the Card specified by the parameter.</returns>
 public static Bitmap GetCardImage(Card card)
 {
     return cardImages[(int)card.GetSuit(), (int)card.GetFaceValue()];
 }
开发者ID:Lavinia01,项目名称:Solitaire---Crazy-Eights-Game,代码行数:9,代码来源:Images.cs


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