Пример #1
0
 public override GameState execute(GameState current)
 {
     Player newPlayer = new Player(card, player);
     newPlayer = newPlayer.removeCard(card);
     GameState g = current.adjustPlayer(newPlayer);
     g.advanceMove();
     g = g.recalcBestCardHolder(g, newPlayer, card.color);
     return g;
 }
Пример #2
0
        public override GameState execute(GameState current)
        {
            Player newPlayer = new Player(card, player);

            newPlayer = newPlayer.removeCard(card);
            GameState g = current.adjustPlayer(newPlayer);

            g.advanceMove();
            g = g.recalcBestCardHolder(g, newPlayer, card.color);
            return(g);
        }
Пример #3
0
        public override GameState execute(GameState current)
        {
            Debug.Assert(debug_gs == null || debug_gs == current, "Action used on an unintended gamestate");

            Map       newMap = current.map.addStation(position);
            GameState g      = new GameState(current, newMap);

            player = player.removeCard(position);
            g.players[g.currentPlayerNum] = player;
            g.advanceMove();
            g = g.recalcBestCardHolder(g, player, position.color);
            return(g);
        }
Пример #4
0
        public override GameState execute(GameState gs)
        {
            Player newFrom = from.removeCard(card);
            Player newTo   = to.addCard(card);

            gs = gs.adjustPlayer(newFrom);
            gs = gs.recalcBestCardHolder(gs, newFrom, card.color);
            gs = gs.adjustPlayer(newTo);
            gs = gs.recalcForAddCard(newTo, card);

            gs.advanceMove();
            return(gs);
        }
Пример #5
0
        public override GameState execute(GameState gs)
        {
            Player player       = gs.currentPlayer();
            int    cardsRemoved = 0;

            foreach (City card in player.cards)
            {
                if (cardsRemoved == 5 || (cardsRemoved == 4 && gs.currentPlayer().type == Player.Type.SCIENTIST))
                {
                    break;
                }
                if (color == card.color)
                {
                    player = player.removeCard(card);
                    cardsRemoved++;
                }
            }
            GameState result = gs.cureDisease(color);

            result = result.adjustPlayer(player);
            result.advanceMove();
            result = result.recalcBestCardHolder(result, gs.currentPlayer(), color);
            return(result);
        }