本文整理汇总了C#中Card.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Card.GetName方法的具体用法?C# Card.GetName怎么用?C# Card.GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateCardTexture
public void UpdateCardTexture(bool alwaysShow, BoardState board, Card card, CardStates State, string classType)
{
StringBuilder ImagePath = new StringBuilder(@"Textures/Cards/");
ImagePath.Append(card.GetCardGFX());
StringBuilder CardbackPath = new StringBuilder(@"Textures/");
if (card.PlayerID == 0)
CardbackPath.Append("Lannister cardback");
else
CardbackPath.Append("Stark cardback");
int attack = board.GetCardAttack(card);
string manaString = "<b>" + board.GetCardManaCost(card).ToString() + "</b>";
string attackString = "<b>" + attack.ToString() + "</b>";
string healthString = "<b>" + board.GetCardHealth(card).ToString() + "</b>";
if (board.GetCardMaxHealth(card) > board.GetCardHealth(card))
healthString = "<color=MAROON>" + healthString + "</color>";
UpdateCard(alwaysShow || State == CardStates.InHand && card.PlayerID == 0,@"<b>" + card.GetName() + @"</b>", ImagePath.ToString(), CardbackPath.ToString(), manaString, attackString, attack > 0, healthString, State, classType);
}
示例2: UpdateGraphics
void UpdateGraphics(BoardState Board, Card Card)
{
this.cardID = Card.ID;
Hand.SetActive(false);
Hero.SetActive(false);
Minion.SetActive(false);
#region build mana string
StringBuilder manaString = new StringBuilder("<b>");
int mana = Board.GetCardManaCost(Card);
manaString.Append(mana);
manaString.Append("</b>");
#endregion
#region build attack string
StringBuilder attackString = new StringBuilder("<b>");
int attack = Board.GetCardAttack(Card);
attackString.Append(attack);
attackString.Append("</b>");
#endregion
#region build health string
StringBuilder healthString = new StringBuilder("<b>");
int health = Board.GetCardHealth(Card);
bool isDamaged = false;
if (health < Card.GetBaseMaxHealth())
isDamaged = true;
if (isDamaged)
healthString.Append("<color=RED>");
healthString.Append(health);
if (isDamaged)
healthString.Append("</color>");
healthString.Append("</b>");
#endregion
#region build name string
StringBuilder nameString = new StringBuilder();
nameString.Append(Card.GetName());
#endregion
#region build texture path
StringBuilder texturePath = new StringBuilder(@"Textures/Cards");
texturePath.Append(Card.GetCardGFX());
#endregion
if (Card.State == CardStates.Hero)
{
Hero.SetTexturePath(texturePath.ToString());
Hero.SetAttack(attackString.ToString(), attack != 0);
Hero.SetHealth(healthString.ToString(), true);
Hero.SetActive(true);
}
else if (Card.State == CardStates.InHand || Card.State == CardStates.InDeck)
{
Hand.SetTexturePath(texturePath.ToString());
Hand.SetMana(manaString.ToString());
Hand.SetAttack(attackString.ToString());
Hand.SetHealth(healthString.ToString());
Hand.SetName(nameString.ToString());
Hand.SetActive(true);
}
else if (Card.State == CardStates.OnBoard)
{
Minion.SetTexturePath(texturePath.ToString());
Minion.SetTexturePath(Card.GetCardGFX());
Minion.SetAttack(attackString.ToString());
Minion.SetHealth(healthString.ToString());
}
}