예제 #1
0
        public GameEngine(Player.Type hType, int difficultyLevel, Boolean allAI)
        {
            //initialize infection and player decks and map
            Map         map   = initializeCities();
            Deck <City> ideck = initializeInfectionDeck(map);

            //initialize player deck

            gs     = new GameState(atlanta, map, 4, 4, ideck, initializePlayerDeck(map));
            gs.map = initializeBoard(map);
            if (!allAI)
            {
                gs.players[0].isAI = false;
            }

            foreach (Player p in gs.players)
            {
                gs = gs.drawPlayerCards(p, 5);
                List <City> drawn = gs.playerDeck.mostRecent(5);
                p.cards.AddRange(drawn);
                gs = gs.adjustPlayer(p);
            }


            List <int> cardLocations = makeEpidemicCards(gs.playerDeck.drawDeck.Count, difficultyLevel);

            for (int i = 0; i < cardLocations.Count; i++)
            {
                cardLocations[i] = cardLocations[i] + gs.playerDeck.cardWeAreOn + 1;
            }

            gs.playerDeck.epidemicCards = cardLocations;
            //ev = new HatesDisease(100);
            ev = new outbreakHater(true);
        }
예제 #2
0
        public GameEngine(Player.Type hType, int difficultyLevel, Boolean allAI)
        {

            //initialize infection and player decks and map
            Map map = initializeCities();
            Deck<City> ideck = initializeInfectionDeck(map);
            //initialize player deck

            gs = new GameState(atlanta, map, 4, 4, ideck, initializePlayerDeck(map));
            gs.map = initializeBoard(map);
            if (!allAI)
            {
                gs.players[0].isAI = false;
            }

            foreach (Player p in gs.players)
            {
                gs = gs.drawPlayerCards(p, 5);
                List<City> drawn = gs.playerDeck.mostRecent(5);
                p.cards.AddRange(drawn);
                gs = gs.adjustPlayer(p);
            }


            List<int> cardLocations = makeEpidemicCards(gs.playerDeck.drawDeck.Count, difficultyLevel);

            for (int i = 0; i < cardLocations.Count; i++)
            {
                cardLocations[i] = cardLocations[i] + gs.playerDeck.cardWeAreOn + 1;
            }

            gs.playerDeck.epidemicCards = cardLocations;
            //ev = new HatesDisease(100);
            ev = new outbreakHater(true);

        }
예제 #3
0
 public GameState doSteps(GameState initial, SearchEvaluate eval, int steps, int depth)
 {
     GameState current = initial;
     for (int i = 0; i < steps; i++)
     {
         Action move = eval.bfs_findbest(current, depth);
         current = move.execute(current);
     }
     return current;
 }