Exemplo n.º 1
0
        public void runAction()
        {
            Action a;
            if (gs.currentPlayer().isAI)
            {
                a = ev.bfs_findbest(gs, 9);
            }
            else
            {
                ActionChooser foo = new ActionChooser(gs.availableActions());
                foo.ShowDialog();
                a = foo.selection;
            }
            lastAction = a;
            gs = a.execute(gs);

            if (gs.hasEpidemic)
            {
                gs.hasEpidemic = false;
                MessageBox.Show("Epidemic Occured!");

            }

            //throw up some GUI
            if (gs.hasLost())
            {
                MessageBox.Show("You Lost");
                Application.Exit();
            }

            if (gs.hasWon())
            {
                MessageBox.Show("You Won");
                Application.Exit();
            }


        }
Exemplo n.º 2
0
        public void runAction()
        {
            Action a;

            if (gs.currentPlayer().isAI)
            {
                a = ev.bfs_findbest(gs, 9);
            }
            else
            {
                ActionChooser foo = new ActionChooser(gs.availableActions());
                foo.ShowDialog();
                a = foo.selection;
            }
            lastAction = a;
            gs         = a.execute(gs);

            if (gs.hasEpidemic)
            {
                gs.hasEpidemic = false;
                MessageBox.Show("Epidemic Occured!");
            }

            //throw up some GUI
            if (gs.hasLost())
            {
                MessageBox.Show("You Lost");
                Application.Exit();
            }

            if (gs.hasWon())
            {
                MessageBox.Show("You Won");
                Application.Exit();
            }
        }
Exemplo n.º 3
0
        public void TestWin()
        {
            gs = gs.cureDisease(DiseaseColor.BLUE);
            gs = gs.cureDisease(DiseaseColor.YELLOW);
            gs = gs.cureDisease(DiseaseColor.ORANGE);
            Assert.IsFalse(gs.hasWon());
            gs = gs.cureDisease(DiseaseColor.BLACK);
            Assert.IsTrue(gs.hasWon());

        }