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


C# Card类代码示例

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


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

示例1: Auto

 public override void Auto(CardState cs, Card ownerEffect)
 {
     if(cs == CardState.EndTurn)
     {
         bCanUseAct1 = true;
     }
 }
开发者ID:Javierudec,项目名称:VGOnline_Scripts,代码行数:7,代码来源:SilverThornEmpressVenusLuquier.cs

示例2: IsShadingMatch

 /// <summary>
 /// True if all three cards are the same shading,
 /// or all three cards have different shadings from each other.
 /// </summary>
 public static bool IsShadingMatch(Card firstCard, Card secondCard, Card thirdCard)
 {
     return (firstCard.Shading == secondCard.Shading && firstCard.Shading == thirdCard.Shading)
            ||
            (firstCard.Shading != secondCard.Shading && firstCard.Shading != thirdCard.Shading &&
             secondCard.Shading != thirdCard.Shading);
 }
开发者ID:GennrichJ,项目名称:Set,代码行数:11,代码来源:Card.cs

示例3: PreFlop

        public static double PreFlop(Card firstCard, Card secondCard)
        {
            int row = 13 - ((int)firstCard.Type - 1);
            int col = 13 - ((int)secondCard.Type - 1);

            return StartingHandRecommendationPercentage[row, col];
        }
开发者ID:Project-ElkY,项目名称:Project,代码行数:7,代码来源:InitialHandEvaluation.cs

示例4: Auto

 public override void Auto(CardState cs, Card ownerEffect)
 {
     if(cs == CardState.Attacking)
     {
         if(GetDefensor().IsVanguard()
            && NumUnits(delegate(Card c) { return true; }) > NumEnemyUnits(delegate(Card c) { return true; })
            && LimitBreak(4)
            && CB(1, delegate(Card c) { return c.name.Contains("Revenger"); })
            && VC())
         {
             bUseAuto1 = true;
             DisplayConfirmationWindow();
         }
     }
     else if(cs == CardState.BeginMain)
     {
         if(VC ()
            && NumUnits (delegate(Card c) { return c.BelongsToClan("Shadow Paladin"); }) > 0
            && NumEnemyUnits(delegate(Card c) { return true; }) > 0)
         {
             bUseAuto2 = true;
             DisplayConfirmationWindow();
         }
     }
 }
开发者ID:Javierudec,项目名称:VGOnline_Scripts,代码行数:25,代码来源:RevengerDesperateDragon.cs

示例5: IsColorMatch

 /// <summary>
 /// True if all three cards are the same color,
 /// or all three cards have different colors from each other.
 /// </summary>
 public static bool IsColorMatch(Card firstCard, Card secondCard, Card thirdCard)
 {
     return (firstCard.Color == secondCard.Color && firstCard.Color == thirdCard.Color)
            ||
            (firstCard.Color != secondCard.Color && firstCard.Color != thirdCard.Color &&
             secondCard.Color != thirdCard.Color);
 }
开发者ID:GennrichJ,项目名称:Set,代码行数:11,代码来源:Card.cs

示例6: CalculateRisk

        public static CardValuationType CalculateRisk(Card leftCard, Card rightCard, IReadOnlyCollection<Card> communityCard)
        {
            List<Card> cards = new List<Card>(communityCard);
            cards.Add(leftCard);
            cards.Add(rightCard);

            var handRankType = Helpers.GetHandRank(cards);

            switch (handRankType)
            {
                case HandRankType.Pair:
                    return CardValuationType.Risky;
                case HandRankType.TwoPairs:
                    return CardValuationType.Recommended;
                case HandRankType.ThreeOfAKind:
                case HandRankType.Straight:
                    return CardValuationType.VeryRecommended;
                case HandRankType.Flush:
                case HandRankType.FullHouse:
                case HandRankType.FourOfAKind:
                    return CardValuationType.VeryPowerful;
                case HandRankType.StraightFlush:
                    return CardValuationType.AllIn;
                default:
                    return CardValuationType.Unplayable;
            }
        }
开发者ID:tddold,项目名称:Team-TheChurch,代码行数:27,代码来源:FlopHandStrength.cs

示例7: ShouldReturn6ForNumberValueAndHForSuit

        public void ShouldReturn6ForNumberValueAndHForSuit()
        {
            Card c = new Card("6H");

            Assert.Equal(6, c.NumberValue);
            Assert.Equal("H", c.Suit);
        }
开发者ID:Fredi,项目名称:PokerHandsKata,代码行数:7,代码来源:CardTests.cs

示例8: ToStringAceSpades

 public void ToStringAceSpades()
 {
     Card card = new Card(CardFace.Ace, CardSuit.Spades);
     var excpected = "A♠";
     var actual = card.ToString();
     Assert.AreEqual(excpected, actual);
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例9: PutCard

        public async Task<IHttpActionResult> PutCard(int id, Card card)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != card.Id)
            {
                return BadRequest();
            }

            db.Entry(card).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CardExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:ericosg,项目名称:godai-api,代码行数:32,代码来源:CardsController.cs

示例10: ToStringTwoClubs

 public void ToStringTwoClubs()
 {
     Card card = new Card(CardFace.Two, CardSuit.Clubs);
     var excpected = "2♣";
     var actual = card.ToString();
     Assert.AreEqual(excpected, actual);
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例11: ToStringJackHearts

 public void ToStringJackHearts()
 {
     Card card = new Card(CardFace.Jack, CardSuit.Hearts);
     var excpected = "J♥";
     var actual = card.ToString();
     Assert.AreEqual(excpected, actual);
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例12: CreatingTwoSameCardsAndInvokingEqualsShouldReturnThatCardsAreEqual

        public void CreatingTwoSameCardsAndInvokingEqualsShouldReturnThatCardsAreEqual()
        {
            var card = new Card(CardFace.Ace, CardSuit.Hearts);
            var anotherCard = new Card(CardFace.Ace, CardSuit.Hearts);

            Assert.IsTrue(card.Equals(anotherCard));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:CardTests.cs

示例13: CreatingTwoDifferentCardsAndInvokingEqualsShouldReturnThatCardsAreNotEqual

        public void CreatingTwoDifferentCardsAndInvokingEqualsShouldReturnThatCardsAreNotEqual()
        {
            var card = new Card(CardFace.Ace, CardSuit.Hearts);
            var anotherCard = new Card(CardFace.Ace, CardSuit.Clubs);

            Assert.IsFalse(card.Equals(anotherCard));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:CardTests.cs

示例14: CreatingACardAndInvokingToStringToItShouldReturnCorrectString

        public void CreatingACardAndInvokingToStringToItShouldReturnCorrectString()
        {
            var card = new Card(CardFace.Ace, CardSuit.Hearts);
            var expectedValue = "Ace of Hearts";

            Assert.AreEqual(expectedValue, card.ToString());
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:CardTests.cs

示例15: Update

    public override void Update()
    {
        DelayUpdate(delegate {
            if(GetBool(1))
            {
                if(currentCard.BelongsToClan(OwnerCard.clan))
                {
                    FromDeckToGuardianCircle(currentCard);
                }
                else
                {
                    SendCardFromDeckToDrop();
                    ResolveQuintetWallNextCard();
                }
            }
            else
            {
                CounterBlast(1,
                             delegate {
                    numCardsToCall = 5;
                });
            }
        });

        FromDeckToGuardianCircleUpdate(delegate {
            ResolveQuintetWallNextCard();
        });

        if(numCardsToCall > 0 && !GetBool(1))
        {
            SetBool(1);
            currentCard = RevealTopCard();
            Delay(0.8f);
        }
    }
开发者ID:Javierudec,项目名称:VGOnline_Scripts,代码行数:35,代码来源:QuintetWall.cs


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