Esempio n. 1
0
        public void TestDisease()
        {
            City atlanta = map.addCity("Atlanta", DiseaseColor.BLUE);

            City.makeAdjacent(newyork, atlanta);
            map = map.addDisease(newyork);
            gs  = new GameState(newyork, map, 1, 100);
            SearchEvaluate cleaner = new Pandemic.HatesDisease(1);

            Assert.AreEqual(1, Pandemic.HatesDisease.getTotalDisease(gs));
            Action action = cleaner.bfs_findbest(gs, 1);

            gs = action.execute(gs);
            Assert.AreEqual(0, Pandemic.HatesDisease.getTotalDisease(gs));
            gs = new GameState(gs, gs.map.addDisease(newark));
            Assert.AreEqual(1, Pandemic.HatesDisease.getTotalDisease(gs));
            gs = cleaner.bfs_findbest(gs, 2).execute(gs);
            gs = cleaner.bfs_findbest(gs, 2).execute(gs);
            Assert.AreEqual(0, Pandemic.HatesDisease.getTotalDisease(gs));
        }
Esempio n. 2
0
 public void TestTwoPlayers()
 {
     City atlanta = map.addCity("Atlanta", DiseaseColor.BLUE);
     City.makeAdjacent(newyork, atlanta);
     map = map.addDisease(newark);
     map = map.addDisease(atlanta);
     gs = new GameState(newyork, map, 2, 2);
     gs = gs.setTurnAction(new DoNothingTurnAction());
     SearchEvaluate hatesDisease = new HatesDisease(2);
     GameState newGS = doSteps(gs, hatesDisease, 5, 5);
     Assert.AreEqual(0, HatesDisease.getTotalDisease(newGS));
 }
Esempio n. 3
0
 public void TestDisease()
 {
     City atlanta = map.addCity("Atlanta", DiseaseColor.BLUE);
     City.makeAdjacent(newyork, atlanta);
     map = map.addDisease(newyork);
     gs = new GameState(newyork, map, 1, 100);
     SearchEvaluate cleaner = new Pandemic.HatesDisease(1);
     Assert.AreEqual(1, Pandemic.HatesDisease.getTotalDisease(gs));
     Action action = cleaner.bfs_findbest(gs, 1);
     gs = action.execute(gs);
     Assert.AreEqual(0, Pandemic.HatesDisease.getTotalDisease(gs));
     gs = new GameState(gs, gs.map.addDisease(newark));
     Assert.AreEqual(1, Pandemic.HatesDisease.getTotalDisease(gs));
     gs = cleaner.bfs_findbest(gs, 2).execute(gs);
     gs = cleaner.bfs_findbest(gs, 2).execute(gs);
     Assert.AreEqual(0, Pandemic.HatesDisease.getTotalDisease(gs));
 }