本文整理汇总了C#中Dominion.GameState.GetPile方法的典型用法代码示例。如果您正苦于以下问题:C# GameState.GetPile方法的具体用法?C# GameState.GetPile怎么用?C# GameState.GetPile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.GameState
的用法示例。
在下文中一共展示了GameState.GetPile方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreferMoneyOverDuchy
private static bool PreferMoneyOverDuchy(DefaultPlayerAction playerAction, GameState gameState)
{
if (!gameState.GetPile(Dominion.Cards.Duchy).Any)
return true;
int minCoin = gameState.Self.ExpectedCoinValueAtEndOfTurn;
int maxCoin = minCoin + 3;
Card mostExpensiveCard = playerAction.purchaseOrder.GetPreferredCard(gameState, card => card.CurrentCoinCost(gameState.Self) > minCoin && card.CurrentCoinCost(gameState.Self) <= maxCoin);
Card thatOrDuchy = playerAction.purchaseOrder.GetPreferredCard(gameState, card => card == Dominion.Cards.Duchy || card == mostExpensiveCard);
if (mostExpensiveCard != null && thatOrDuchy != Dominion.Cards.Duchy)
return true;
return false;
}
示例2: EndGame
public override void EndGame(GameState gameState)
{
lock (this.factory.theLock)
{
if (gameState.GetPile(Cards.Curse).Any)
return;
int player1Count = CountCurses(gameState, 0);
int player2Count = CountCurses(gameState, 1);
if (player1Count > player2Count)
this.factory.player1Win++;
if (player2Count > player1Count)
this.factory.player2Win++;
this.factory.totalGameCount++;
}
if (gameState.WinningPlayers.Count() > 1)
{
int playerIndex = gameState.WinningPlayers[0].PlayerIndex;
//winningPlayerWas25++;
}
}
示例3: ReturnCardToSupply
internal void ReturnCardToSupply(Card cardToReturn, GameState gameState)
{
this.gameLog.PlayerReturnedCardToPile(this, cardToReturn);
PileOfCards pile = gameState.GetPile(cardToReturn);
if (pile == null)
throw new Exception("Could not find supply pile");
pile.AddCardToTop(cardToReturn);
}
示例4: RequestPlayerEmbargoPileFromSupply
internal PileOfCards RequestPlayerEmbargoPileFromSupply(GameState gameState)
{
Card cardType = this.actions.GetCardFromSupplyToEmbargo(gameState);
PileOfCards pile = gameState.GetPile(cardType);
if (pile == null)
{
throw new Exception("Must choose pile from supply");
}
return pile;
}
示例5: RequestPlayerDiscardCardFromHand
internal bool RequestPlayerDiscardCardFromHand(GameState gameState, CardPredicate acceptableCardsToDiscard, bool isOptional)
{
if (!this.hand.HasCard(acceptableCardsToDiscard))
{
return false;
}
Card cardTypeToDiscard = this.actions.GetCardFromHandToDiscard(gameState, acceptableCardsToDiscard, isOptional);
if (cardTypeToDiscard == null)
{
if (isOptional)
{
return false;
}
else
{
throw new Exception("Player must choose a card to discard");
}
}
else
{
if (gameState.GetPile(cardTypeToDiscard) != null && // TODO: this currently can not find ruins ... rework this method so a card is returned instead of a type.
!acceptableCardsToDiscard( cardTypeToDiscard))
throw new Exception("Card does not meet constraint: ");
}
this.MoveCardFromHandToDiscard(cardTypeToDiscard, gameState);
return true;
}
示例6: CountOfPile
public static int CountOfPile(Card cardType, GameState gameState)
{
if (!gameState.CardGameSubset.HasCard(cardType))
return 0;
return gameState.GetPile(cardType).Count;
}
示例7: MoveCardFromPlayToPile
internal bool MoveCardFromPlayToPile(GameState gameState)
{
bool wasReturned = false;
Card cardInPlay = this.cardsBeingPlayed.DrawCardFromTop();
if (cardInPlay != null)
{
PileOfCards pile = gameState.GetPile(cardInPlay);
pile.AddCardToTop(cardInPlay);
wasReturned = true;
this.gameLog.PlayerReturnedCardToPile(this, cardInPlay);
}
this.cardsBeingPlayed.AddCardToTop(null);
return wasReturned;
}
示例8: CountOfPile
public static int CountOfPile(Card cardType, GameState gameState)
{
return gameState.GetPile(cardType).Count;
}