Exemple #1
0
 public void testPlayCouncilRoom()
 {
     Game g = new Game(2);
     Player p = g.getCurrentPlayer();
     p.getHand().getHand().Add(CardMother.CouncilRoom());
     p.play(CardMother.CouncilRoom());
     Assert.AreEqual(9, p.getHand().size());
     Assert.AreEqual(2, p.getBuysLeft());
     p = g.nextTurnPlayer();
     p.callDelayedFunctions();
     Assert.AreEqual(6, p.getHand().size());
 }
Exemple #2
0
 public void testPlayMilitiaSetup()
 {
     Game g = new Game(2);
     Player p = g.getCurrentPlayer();
     p.getHand().getHand().Add(CardMother.Militia());
     StatusObject o = p.play(CardMother.Militia());
     Assert.IsTrue(o.wasPlayedProperly());
     Assert.AreEqual(7, p.getCurrency());
     p = g.nextTurnPlayer();
     Assert.AreEqual(1, p.functionsToCall.Count);
     o = p.callDelayedFunctions();
     Assert.IsTrue(o.wasMilitiaPlayed());
     Assert.IsTrue(o.needToContinueWithDelayedFunctions());
     List<Card> cards = new List<Card>();
     o = p.militiaDiscardEffect(cards);
     Assert.IsTrue(o.wasMilitiaPlayed());
     cards.Add(CardMother.Copper());
     cards.Add(CardMother.Copper());
     o = p.militiaDiscardEffect(cards);
     Assert.IsFalse(o.wasMilitiaPlayed());
     Assert.IsTrue(o.needToContinueWithDelayedFunctions());
     o = p.callDelayedFunctions();
     Assert.IsFalse(o.needToContinueWithDelayedFunctions());
 }
Exemple #3
0
 private void End_Turn_Click(object sender, RoutedEventArgs e)
 {
     player.cleanUp();
     this.Hide();
     Todo.Text = "";
     PrepScreen prep = new PrepScreen(myGame.nextPlayerName(), this);
     prep.Show();
     player = myGame.nextTurnPlayer();
     actiondone = "";
     phase = "Action Phase";
     Player_Label.Content = player.getName() + "'s";
     Phase_Label.Content = phase;
     End_Phase.IsEnabled = true;
     player.getCurrency();
     ResetHilightedCards();
     Turn_Label.Content = myGame.getTurnsPassed();
     RefreshWindow();
     StatusObject status = player.callDelayedFunctions();
     RefreshWindow();
     Todo.Text = status.getMessage();
     if (status.wasMilitiaPlayed()) {
         militia();
         return;
     }
 }