本文整理汇总了C#中Card类的典型用法代码示例。如果您正苦于以下问题:C# Card类的具体用法?C# Card怎么用?C# Card使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Card类属于命名空间,在下文中一共展示了Card类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Auto
public override void Auto(CardState cs, Card effectOwner)
{
if(cs == CardState.EndTurn)
{
_AuxBool = false;
}
}
开发者ID:Javierudec,项目名称:VGOnline_Scripts,代码行数:7,代码来源:ImperialDaughter.cs
示例17: PreOverlayRender
// Overlay hooks
public void PreOverlayRender(Card card)
{
CardType type = allCardTypes[card.typeId];
if( origNames.ContainsKey(type.id) ) {
type.name = origNames[type.id];
}
}
开发者ID:noHero123,项目名称:ScrollsPost,代码行数:8,代码来源:TradePrices.cs
示例18: PlayCardOnHex
public override Unit PlayCardOnHex(Card card, Hex hex, string id)
{
CardHistory.Add(card);
GuiControl.AddCardToHistory(card);
// TODO Clean up this method to better handle multiple card types.
if(typeof(EntityCard).IsAssignableFrom(card.GetType())) {
EntityCard eCard = (EntityCard) card;
GameObject go = (GameObject) Instantiate(UnitPrefab, Vector3.zero, Quaternion.identity);
Unit unit = go.GetComponent<Unit>();
unit.Id = id;
unit.FromCard(eCard);
unit.Hex = hex;
unit.transform.position = hex.transform.position;
hex.Unit = unit;
Units.Add(unit);
unit.Team = MyTurn() ? Team.ME : Team.ENEMY;
if(MyTurn() && ThisPlayer.Hand.Count != 0) {
// TODO Find a better way to sort this
ThisPlayer.PlayCard();
}
card.OnPlay(new StateObject(Units, hex, null, MyTurn() ? ThisPlayer : EnemyPlayer, MyTurn() ? EnemyPlayer : ThisPlayer));
return unit;
} else {
if(MyTurn() && ThisPlayer.Hand.Count != 0) {
// TODO Find a better way to sort this
ThisPlayer.PlayCard();
}
card.OnPlay(new StateObject(Units, hex, null, MyTurn() ? ThisPlayer : EnemyPlayer, MyTurn() ? EnemyPlayer : ThisPlayer));
return null;
}
}
开发者ID:AndersHqst,项目名称:Battle-For-Betelgeuse,代码行数:31,代码来源:KingOfTheHill.cs
示例19: ShouldReturn12ForNumberValueAndCForSuit
public void ShouldReturn12ForNumberValueAndCForSuit()
{
Card c = new Card("QC");
Assert.Equal(12, c.NumberValue);
Assert.Equal("C", c.Suit);
}
开发者ID:Fredi,项目名称:PokerHandsKata,代码行数:7,代码来源:CardTests.cs
示例20: handstring
private string handstring(Card[] hand)
{
return
hand.Select(c => Ranks[c.Rank] + "" + Suits[(int) c.Suit])
.Aggregate("", (h, c) => h + " " + c)
.Remove(0, 1);
}
开发者ID:charvey,项目名称:ProjectEuler,代码行数:7,代码来源:Problem054.cs
注:本文中的Card类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论