本文整理汇总了C#中Dominion.PlayerState.RequestPlayerChooseBetween方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.RequestPlayerChooseBetween方法的具体用法?C# PlayerState.RequestPlayerChooseBetween怎么用?C# PlayerState.RequestPlayerChooseBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.PlayerState
的用法示例。
在下文中一共展示了PlayerState.RequestPlayerChooseBetween方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice actionChoice = currentPlayer.RequestPlayerChooseBetween(
gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard ||
acceptableChoice == PlayerActionChoice.PlusCoin ||
acceptableChoice == PlayerActionChoice.Trash);
switch (actionChoice)
{
case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Silver.card, gameState); break;
case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(1); break;
case PlayerActionChoice.Trash: currentPlayer.RequestPlayerTrashCardsFromHand(gameState, 1, false); break;
default: throw new Exception("Invalid case");
}
}
示例2: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.PutNativeVillageMatInHand ||
acceptableChoice == PlayerActionChoice.SetAsideTopCardOnNativeVillageMat);
if (choice == PlayerActionChoice.PutNativeVillageMatInHand)
{
currentPlayer.MoveNativeVillageMatToHand();
}
else if (choice == PlayerActionChoice.SetAsideTopCardOnNativeVillageMat)
{
currentPlayer.MoveCardFromPlayedCardToNativeVillageMatt(this);
currentPlayer.PutOnNativeVillageMatCardFromTopOfDeck();
}
}
示例3: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice playerChoice = currentPlayer.RequestPlayerChooseBetween(gameState, acceptableChoice =>
acceptableChoice == PlayerActionChoice.GainCard ||
acceptableChoice == PlayerActionChoice.PlusCard ||
acceptableChoice == PlayerActionChoice.Trash);
switch (playerChoice)
{
case PlayerActionChoice.PlusCard:
{
currentPlayer.DrawAdditionalCardsIntoHand(3, gameState);
foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
{
otherPlayer.DrawAdditionalCardsIntoHand(1, gameState);
}
break;
}
case PlayerActionChoice.GainCard:
{
currentPlayer.GainCardFromSupply(gameState, Gold.card);
foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
{
otherPlayer.GainCardFromSupply(gameState, Silver.card);
}
break;
}
case PlayerActionChoice.Trash:
{
currentPlayer.RequestPlayerTrashCardFromHandAndGainCard(
gameState,
acceptableCardsToTrash => true,
CostConstraint.Exactly,
2,
CardRelativeCost.RelativeCost,
isOptionalToTrash: true,
isOptionalToGain: false);
foreach (PlayerState otherPlayer in gameState.players.OtherPlayers)
{
otherPlayer.RequestPlayerTrashCardFromHandAndGainCard(
gameState,
acceptableCardsToTrash => true,
CostConstraint.Exactly,
1,
CardRelativeCost.RelativeCost,
isOptionalToTrash: true,
isOptionalToGain: false);
}
break;
}
}
}
示例4: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
if (currentPlayer.RequestPlayerTrashCardFromHand(gameState, card => card.isTreasure, isOptional:true) != null)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(
gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.PlusCard || acceptableChoice == PlayerActionChoice.PlusCoin);
switch (choice)
{
case PlayerActionChoice.PlusCard:
{
currentPlayer.DrawAdditionalCardsIntoHand(2);
currentPlayer.AddActions(1);
break;
}
case PlayerActionChoice.PlusCoin:
{
currentPlayer.AddCoins(2);
currentPlayer.AddBuys(1);
break;
}
default:
throw new Exception();
}
}
}
示例5: DoSpecializedAttack
public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
{
PlayerActionChoice playerChoice = otherPlayer.RequestPlayerChooseBetween(
gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.Discard ||
acceptableChoice == PlayerActionChoice.GainCard);
switch (playerChoice)
{
case PlayerActionChoice.Discard: otherPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); break;
case PlayerActionChoice.GainCard: otherPlayer.GainCardFromSupply(Curse.card, gameState, DeckPlacement.Hand); break;
default: throw new Exception("Invalid Choice");
}
}
示例6: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
IsValidChoice acceptableFirstChoice = delegate(PlayerActionChoice acceptableChoice)
{
return acceptableChoice == PlayerActionChoice.PlusCard ||
acceptableChoice == PlayerActionChoice.PlusAction ||
acceptableChoice == PlayerActionChoice.PlusBuy ||
acceptableChoice == PlayerActionChoice.PlusCoin;
};
PlayerActionChoice firstChoice = currentPlayer.RequestPlayerChooseBetween(
gameState,
acceptableFirstChoice);
PlayerActionChoice secondChoice = currentPlayer.RequestPlayerChooseBetween(
gameState,
acceptableSecondChoice => acceptableSecondChoice != firstChoice && acceptableFirstChoice(acceptableSecondChoice));
DoActionChoice(currentPlayer, firstChoice);
DoActionChoice(currentPlayer, secondChoice);
}
示例7: OverpayOnPurchase
public override void OverpayOnPurchase(PlayerState currentPlayer, GameState gameState, int overpayAmount)
{
for (int i = 0; i < overpayAmount; ++i)
{
if (!currentPlayer.deck.Any())
break;
currentPlayer.LookAtCardsFromDeck(1);
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.Trash ||
acceptableChoice == PlayerActionChoice.Discard ||
acceptableChoice == PlayerActionChoice.TopDeck);
switch (choice)
{
case PlayerActionChoice.Trash:
currentPlayer.RequestPlayerTrashLookedAtCard(gameState);
break;
case PlayerActionChoice.Discard:
currentPlayer.MoveLookedAtCardsToDiscard(gameState);
break;
case PlayerActionChoice.TopDeck:
currentPlayer.MoveLookedAtCardToTopOfDeck();
break;
default:
throw new Exception("Unhandled case");
}
}
}
示例8: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.Discard ||
acceptableChoice == PlayerActionChoice.GainCard ||
acceptableChoice == PlayerActionChoice.TopDeck);
switch (choice)
{
case PlayerActionChoice.Discard: currentPlayer.RequestPlayerDiscardCardsFromHand(gameState, 2, isOptional: false); break;
case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Copper, gameState); break;
case PlayerActionChoice.TopDeck: currentPlayer.RequestPlayerTopDeckCardFromHand(gameState, acceptableCard => true, isOptional: false); break;
}
PlayerActionChoice choice2 = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.PlusCoin ||
acceptableChoice == PlayerActionChoice.Trash ||
acceptableChoice == PlayerActionChoice.GainCard);
switch (choice2)
{
case PlayerActionChoice.PlusCoin: currentPlayer.AddCoins(3); break;
case PlayerActionChoice.Trash: currentPlayer.TrashHand(gameState); break;
case PlayerActionChoice.GainCard: currentPlayer.GainCardFromSupply(Cards.Duchy, gameState); break;
}
}
示例9: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
IsValidChoice choices = delegate(PlayerActionChoice choice)
{
return choice == PlayerActionChoice.PlusCard ||
choice == PlayerActionChoice.PlusAction ||
choice == PlayerActionChoice.PlusCoin ||
choice == PlayerActionChoice.GainCard;
};
PlayerActionChoice choice1 = currentPlayer.RequestPlayerChooseBetween(gameState, choices);
PlayerActionChoice choice2 = currentPlayer.RequestPlayerChooseBetween(gameState, c => choices(c) && c != choice1);
ApplyChoice(choice1, currentPlayer, gameState);
ApplyChoice(choice2, currentPlayer, gameState);
}
示例10: DoSpecializedAttack
public override void DoSpecializedAttack(PlayerState currentPlayer, PlayerState otherPlayer, GameState gameState)
{
otherPlayer.RevealCardsFromDeck(2, gameState);
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState, actionChoice => actionChoice == PlayerActionChoice.Discard || actionChoice == PlayerActionChoice.TopDeck);
switch (choice)
{
case PlayerActionChoice.Discard:
{
otherPlayer.MoveRevealedCardsToDiscard(gameState);
break;
}
case PlayerActionChoice.TopDeck:
{
otherPlayer.RequestPlayerTopDeckRevealedCardsInAnyOrder(gameState);
break;
}
default:
throw new Exception();
}
}
示例11: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.GainCard || acceptableChoice == PlayerActionChoice.Trash);
if (choice == PlayerActionChoice.GainCard)
{
currentPlayer.RequestPlayerGainCardFromTrash(gameState,
acceptableCard => CardValidToGainFromTrash(acceptableCard, currentPlayer),
"Must gain a card costing between 3 and 6",
defaultLocation: DeckPlacement.TopOfDeck);
}
else
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => CardValidToTrash(acceptableCard), isOptional: false);
if (trashedCard != null)
{
int maxCost = trashedCard.CurrentCoinCost(currentPlayer) + 3;
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
acceptableCard => acceptableCard.CurrentCoinCost(currentPlayer) <= maxCost && acceptableCard.potionCost <= trashedCard.potionCost,
"gain a card costing up to 3 more than the trashed card");
}
}
}
示例12: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice =>
acceptableChoice == PlayerActionChoice.PlusCoin ||
acceptableChoice == PlayerActionChoice.Trash);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
bool wasACardTrashed = false;
if (choice == PlayerActionChoice.PlusCoin)
{
currentPlayer.AddCoins(currentPlayer.pirateShipTokenCount);
}
else if (choice == PlayerActionChoice.Trash)
{
attackAction = delegate (PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
{
otherPlayer.RevealCardsFromDeck(2, gameState);
Card trashedCard = currentPlayer2.RequestPlayerTrashOtherPlayersRevealedCard(gameState2, card => card.isTreasure, otherPlayer);
otherPlayer.MoveRevealedCardsToDiscard(gameState);
wasACardTrashed |= trashedCard != null;
};
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
if (wasACardTrashed)
{
currentPlayer.pirateShipTokenCount++;
}
}