Exemple #1
0
        async Task IServer.Access(int accessCount, IPilot pilot, Game game)
        {
            reshuffledDuringAccess = false;
            var accessDepth = 0;

            for (var accessesLeft = accessCount; accessesLeft > 0; accessesLeft--)
            {
                if (accessDepth > Zone.Cards.Count)
                {
                    break;
                }
                var nextCard = Zone.Cards[accessDepth];
                // TODO show top of R&D and cards in root
                // TODO2: should draw facedown
                // TODO3: nice if we could display the pile, not just the top+root
                var cardToAccess = await pilot.ChooseACard().Declare("Which card to access now?", new List <Card> {
                    nextCard
                }, game);

                accessDepth++;
                await new AccessCard(cardToAccess, game).AwaitEnd(); // TODO show the already seen on the side, maintaining proper order CR: 7.2.1.b
                if (reshuffledDuringAccess)                          // CR: 7.2.1.c
                {
                    accessDepth            = 0;
                    reshuffledDuringAccess = false;
                }
            }
        }
Exemple #2
0
        async Task IInstallDestination.TrashAlike(Card card)
        {
            // CR: 8.2.5.d
            if (card.Type is Program && false /* disable until we get proper MU-based trashing below */)
            {
                var programs = zone.Cards.Where(it => it.Type is Program);
                var old      = await pilot.ChooseACard().Declare("Which program to trash?", programs, game); // actually declare zero or many, unless MU is constrained then a minimum

                old.MoveTo(game.runner.zones.heap.zone);                                                     // TODO reuse an actual trash abstraction
            }
        }
Exemple #3
0
        async Task IServer.Access(int accessCount, IPilot pilot, Game game)
        {
            var interestingCards = Zone.Cards.Where(it => it.Type is Agenda).ToList();

            while (interestingCards.Count > 0) // TODO actually access the rest of the cards too, e.g. for Obelus-HadesShard
            {
                var cardToAccess = await pilot.ChooseACard().Declare("Which card to access now?", interestingCards, game);

                interestingCards.Remove(cardToAccess);
                await new AccessCard(cardToAccess, game).AwaitEnd();
            }
        }
Exemple #4
0
        async Task IServer.Access(int accessCount, IPilot pilot, Game game)
        {
            var unaccessed = new List <Card>(Zone.Cards);

            for (var accessesLeft = accessCount; accessesLeft > 0; accessesLeft--)
            {
                var card = await pilot.ChooseACard().Declare("Which card to access now?", unaccessed, game);

                unaccessed.Remove(card);
                await new AccessCard(card, game).AwaitEnd();
            }
        }
        async Task IServer.Access(int accessCount, IPilot pilot, Game game)
        {
            if (Zone.Cards.Count == 0)
            {
                return;
            }
            var unaccessed = new List <Card>(Zone.Cards);

            for (var accessesLeft = accessCount; accessesLeft > 0; accessesLeft--)
            {
                var randomCard = unaccessed
                                 .OrderBy(it => random.Next())
                                 .First();
                var cardToAccess = await pilot.ChooseACard().Declare("Which card to access now?", new List <Card> {
                    randomCard
                }, game);

                unaccessed.Remove(cardToAccess); // TODO : draw already accessed cards on the side
                await new AccessCard(cardToAccess, game).AwaitEnd();
            }
        }
 public virtual IDecision <string, Card> ChooseACard()
 {
     return(basic.ChooseACard());
 }