本文整理汇总了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;
}
}
示例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);
}
示例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];
}
示例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();
}
}
}
示例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);
}
示例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;
}
}
示例7: ShouldReturn6ForNumberValueAndHForSuit
public void ShouldReturn6ForNumberValueAndHForSuit()
{
Card c = new Card("6H");
Assert.Equal(6, c.NumberValue);
Assert.Equal("H", c.Suit);
}
示例8: ToStringAceSpades
public void ToStringAceSpades()
{
Card card = new Card(CardFace.Ace, CardSuit.Spades);
var excpected = "A♠";
var actual = card.ToString();
Assert.AreEqual(excpected, actual);
}
示例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);
}
示例10: ToStringTwoClubs
public void ToStringTwoClubs()
{
Card card = new Card(CardFace.Two, CardSuit.Clubs);
var excpected = "2♣";
var actual = card.ToString();
Assert.AreEqual(excpected, actual);
}
示例11: ToStringJackHearts
public void ToStringJackHearts()
{
Card card = new Card(CardFace.Jack, CardSuit.Hearts);
var excpected = "J♥";
var actual = card.ToString();
Assert.AreEqual(excpected, actual);
}
示例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));
}
示例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));
}
示例14: CreatingACardAndInvokingToStringToItShouldReturnCorrectString
public void CreatingACardAndInvokingToStringToItShouldReturnCorrectString()
{
var card = new Card(CardFace.Ace, CardSuit.Hearts);
var expectedValue = "Ace of Hearts";
Assert.AreEqual(expectedValue, card.ToString());
}
示例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);
}
}