Example #1
0
            public override void Resolve(TurnContext context, ICard source)
            {
                var deck = context.ActivePlayer.Deck;
                var revealZone = new RevealZone(context.ActivePlayer);

                while (deck.TopCard != null && MatchingCards(revealZone).Count() < 2)
                    deck.TopCard.MoveTo(revealZone);

                revealZone.LogReveal(context.Game.Log);
                var revealedTreasure = MatchingCards(revealZone).ToList();

                var discards = revealZone.Where(c => !revealedTreasure.Cast<ICard>().Contains(c)).ToList();

                foreach(var card in discards)
                    card.MoveTo(context.ActivePlayer.Discards);

                foreach (var card in revealedTreasure)
                    card.MoveTo(context.ActivePlayer.Hand);

            }
Example #2
0
            public override void Resolve(TurnContext context, ICard source)
            {
                var deck = context.ActivePlayer.Deck;
                var revealZone = new RevealZone(context.ActivePlayer);

                while (deck.TopCard != null && MatchingActions(revealZone).Count() < 2)
                    deck.TopCard.MoveTo(revealZone);

                revealZone.LogReveal(context.Game.Log);
                var actionsToPlay = MatchingActions(revealZone).ToList();

                var discards = revealZone.Where(c => !actionsToPlay.Cast<ICard>().Contains(c))
                    .ToList();

                foreach(var card in discards)
                    card.MoveTo(context.ActivePlayer.Discards);

                var playUtil = new PlayCardUtility(context);

                if (actionsToPlay.AllSame(a => a.Name))
                    playUtil.Play(actionsToPlay);                                       
                else
                    _activities.Add(CreateChooseActionActivity(context, revealZone, source));
            }