本文整理汇总了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()]);
}
}
示例2: DisplayCard
public void DisplayCard(model.Card a_card)
{
System.Console.WriteLine("{0} of {1}", a_card.GetValue(), a_card.GetColor());
}
示例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());
}