示例#1
0
        public void MakeTurnTest()
        {
            IWizardFrontend testFrontend = null;

            var roundNum = 4;
            var deck     = new Deck();

            deck.Shuffle();

            var aiPlayer     = new AIPlayer(testFrontend, "wizardAI");
            var humanPlayer1 = new HumanPlayer(testFrontend, "Connor");
            var humanPlayer2 = new HumanPlayer(testFrontend, "Diana");

            for (int i = 0; i < roundNum; i++)
            {
                aiPlayer.TakeCard(deck.PopTop());
                humanPlayer1.TakeCard(deck.PopTop());
                humanPlayer2.TakeCard(deck.PopTop());
            }

            var testPlayers = new List <Player>
            {
                aiPlayer,
                humanPlayer1,
                humanPlayer2
            };

            var testGameContext = new GameContext(testPlayers);

            var trumpCard = new Card(CardValue.EIGHT, CardSuite.DIAMONDS);
            var curRound  = new RoundContext(roundNum);

            curRound.TrumpCard = trumpCard;
            testPlayers.ForEach(player => curRound.Bids[player]    = 0);
            testPlayers.ForEach(player => curRound.Results[player] = 0);
            var trick1 = new TrickContext(1);

            trick1.CardsPlayed[0] = (new Card(CardValue.JACK, CardSuite.CLUBS));

            curRound.Tricks[0]        = (trick1);
            testGameContext.Rounds[0] = (curRound);

            aiPlayer.MakeTurn(testGameContext);
        }
示例#2
0
        public void MakeBidTest()
        {
            IWizardFrontend testFrontend = null;

            var roundNum = 3;
            var deck     = new Deck();

            deck.Shuffle();

            var aiPlayer     = new AIPlayer(testFrontend, "wizardAI");
            var humanPlayer1 = new HumanPlayer(testFrontend, "Connor");
            var humanPlayer2 = new HumanPlayer(testFrontend, "Diana");

            for (int i = 0; i < roundNum; i++)
            {
                aiPlayer.TakeCard(deck.PopTop());
                humanPlayer1.TakeCard(deck.PopTop());
                humanPlayer2.TakeCard(deck.PopTop());
            }

            var testPlayers = new List <Player>
            {
                aiPlayer,
                humanPlayer1,
                humanPlayer2
            };
            var testGameContext = new GameContext(testPlayers);

            var trumpCard = new Card(CardValue.EIGHT, CardSuite.DIAMONDS);
            var curRound  = new RoundContext(roundNum);

            curRound.TrumpCard        = trumpCard;
            testGameContext.Rounds[0] = (curRound);

            aiPlayer.MakeBid(testGameContext);
        }
示例#3
0
 public HumanPlayer(IWizardFrontend frontend, string Name) : base(frontend, Name)
 {
 }
示例#4
0
 public WizardEngine(IWizardFrontend frontend)
 {
     _frontend = frontend;
 }
示例#5
0
 public Player(IWizardFrontend frontend, string name)
 {
     Name      = name;
     _hand     = new List <Card>();
     _frontend = frontend;
 }
示例#6
0
 public AIPlayer(IWizardFrontend frontend, string name) : base(frontend, name)
 {
     _rand = new Random();
 }