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


C# model.GetColor方法代码示例

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


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

示例1: DisplayCard

 public void DisplayCard(model.Card a_card)
 {
     if (a_card.GetColor() == model.Card.Color.Hidden)
     {
         System.Console.WriteLine("Dolt Kort");
     }
     else
     {
         String[] colors = new String[(int)model.Card.Color.Count] { "Hjärter", "Spader", "Ruter", "Klöver" };
         String[] values = new String[(int)model.Card.Value.Count] { "två", "tre", "fyra", "fem", "sex", "sju", "åtta", "nio", "tio", "knekt", "dam", "kung", "ess" };
         System.Console.WriteLine("{0} {1}", colors[(int)a_card.GetColor()], values[(int)a_card.GetValue()]);
     }
 }
开发者ID:kristofferlind,项目名称:1dv407-ooad,代码行数:13,代码来源:SwedishView.cs

示例2: DisplayCard

 public void DisplayCard(model.Card a_card)
 {
     System.Console.WriteLine("{0} of {1}", a_card.GetValue(), a_card.GetColor());
 }
开发者ID:Holmewi,项目名称:1dv607-jh222qr-workshops,代码行数:4,代码来源:SimpleView.cs

示例3: PositionCardPictureBoxToShowCorrectCardImage

        private void PositionCardPictureBoxToShowCorrectCardImage(model.Card a_card)
        {
            if (a_card.GetColor() != model.Card.Color.Hidden)
            {
                int[] cardPositions = new int[(int)model.Card.Value.Count] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
                int cardPosition = cardPositions[(int)a_card.GetValue()];

                if (cardPosition == 12) { cardPosition = 0; } // since ace is first in the image
                else { cardPosition += 1; } //+ one step since ace is first in the image

                int left = cardPosition * GetStandardDeckCardImageWidth() + cardPosition; // (int)Math.Round(cardPosition);
                int imageRow = -1;
                switch (a_card.GetColor())
                {
                    case model.Card.Color.Clubs:
                        imageRow = (int)StandardDeckImageCardColorRows.Clubs;
                        break;
                    case model.Card.Color.Diamonds:
                        imageRow = (int)StandardDeckImageCardColorRows.Diamonds;
                        break;
                    case model.Card.Color.Hearts:
                        imageRow = (int)StandardDeckImageCardColorRows.Hearts;
                        break;
                    case model.Card.Color.Spades:
                        imageRow = (int)StandardDeckImageCardColorRows.Spades;
                        break;
                }
                int top = imageRow * GetStandardDeckCardImageHeight();

                pictureBoxCard.Left = -left;
                pictureBoxCard.Top = -top;

                panelCard.Width = GetStandardDeckCardImageWidth();
                panelCard.Height = GetStandardDeckCardImageHeight();
            }
            else
            {
                //hidden card, making sure not shown
                UnShowCard();
            }
        }
开发者ID:of222au,项目名称:1DV607-Objektorienterad-analys-och-design-med-UML,代码行数:41,代码来源:UserControlPlayerCard.cs

示例4: DisplayCard

        public override void DisplayCard(model.Card a_card, String playerStr = "")
        {
            playerStr = (playerStr == "" ? "" : String.Format("{0} got ", playerStr));

            System.Console.WriteLine("{0} of {1}", a_card.GetValue(), a_card.GetColor());
        }
开发者ID:johnnypesola,项目名称:blackjack_csharp,代码行数:6,代码来源:SwedishView.cs


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