本文整理汇总了C#中IGame.GetCardsInPlayWithEffect方法的典型用法代码示例。如果您正苦于以下问题:C# IGame.GetCardsInPlayWithEffect方法的具体用法?C# IGame.GetCardsInPlayWithEffect怎么用?C# IGame.GetCardsInPlayWithEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGame
的用法示例。
在下文中一共展示了IGame.GetCardsInPlayWithEffect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
if (game.StagingArea.CardsInStagingArea.Any(x => x.Card.Id == cardInPlay.BaseCard.Id))
{
game.StagingArea.RemoveFromStagingArea(cardInPlay as IEncounterInPlay);
}
else if (game.QuestArea.ActiveLocation != null && game.QuestArea.ActiveLocation.Card.Id == cardInPlay.BaseCard.Id)
{
game.QuestArea.RemoveActiveLocation();
}
else
{
foreach (var player in game.Players)
{
if (player.CardsInPlay.Any(x => x.BaseCard.Id == cardInPlay.BaseCard.Id))
{
player.RemoveCardInPlay(cardInPlay);
break;
}
}
}
var state = new CardLeavesPlay(game, cardInPlay);
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IAfterCardLeavesPlay>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IAfterCardLeavesPlay>())
{
effect.AfterCardLeavesPlay(state);
}
}
handle.Resolve(GetCompletedStatus());
}
示例2: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
var defeatedState = new EnemyDefeated(game, enemy, attackers);
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IBeforeEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IBeforeEnemyDefeated>())
{
effect.BeforeEnemyDefeated(defeatedState);
}
}
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IDuringEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IDuringEnemyDefeated>())
{
effect.DuringEnemyDefeated(defeatedState);
}
}
if (!defeatedState.IsEnemyDefeated)
{ handle.Cancel(GetCancelledString()); return; }
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IAfterEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IAfterEnemyDefeated>())
{
effect.AfterEnemyDefeated(defeatedState);
}
}
var leavingPlayEffect = new CardLeavesPlayEffect(game, enemy);
game.AddEffect(leavingPlayEffect);
var leavingPlayHandle = leavingPlayEffect.GetHandle(game);
game.TriggerEffect(leavingPlayHandle);
handle.Resolve(GetCompletedStatus());
}
示例3: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
var state = new CardEntersPlay(game, cardInPlay);
foreach (var inPlay in game.GetCardsInPlayWithEffect<ICardInPlay, IAfterCardEntersPlay>())
{
foreach (var effect in inPlay.BaseCard.Text.Effects.OfType<IAfterCardEntersPlay>())
{
effect.AfterCardEntersPlay(state);
}
}
handle.Resolve(GetCompletedStatus());
}