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


C# Card.GetName方法代码示例

本文整理汇总了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);
    }
开发者ID:alex-dmtr,项目名称:Clash-of-Kings,代码行数:18,代码来源:CardHandler.cs

示例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());
        }
    }
开发者ID:alex-dmtr,项目名称:Clash-of-Kings,代码行数:71,代码来源:UICard.cs


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