当前位置: 首页>>代码示例>>C#>>正文


C# IGame.GetCardsInPlayWithEffect方法代码示例

本文整理汇总了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());
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:34,代码来源:CardLeavesPlayEffect.cs

示例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());
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:38,代码来源:EnemyDefeatedEffect.cs

示例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());
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:14,代码来源:CardEntersPlayEffect.cs


注:本文中的IGame.GetCardsInPlayWithEffect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。