當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。