Ejemplo n.º 1
0
        public void ComputeCopyBuildCardTest()
        {
            var manager  = new GameFlowManager();
            var cardName = CardName.SpiesGuild;
            var guild    = new GuildCard(cardName, 3, Age.III, null, null, new List <IEffect> {
                new Effect(EffectType.VictoryPointPerMilitaryCard, 1, PlayerDirection.ToTheLeft | PlayerDirection.ToTheRight)
            });

            manager.CreateNewPlayer("ashley");
            manager.CreateNewPlayer("kate");
            manager.SetupGame();
            var player1 = manager.Players[0];
            var player2 = manager.Players[1];

            player1.SetWonder(WonderFactory.CreateWonder(WonderName.StatueOfZeusInOlimpia, WonderBoardSide.B));
            player1.Wonder.BuildStage();
            player1.Wonder.BuildStage();
            player1.Wonder.BuildStage();
            player1.Wonder.EffectsAvailable.First(e => e.Type == EffectType.CopyGuildFromNeighbor).Info = cardName;

            player2.Cards.Add(guild);

            manager.CollectPostGameRewards();

            Assert.IsTrue(player1.Cards.Any(c => c.Name == cardName));
        }
Ejemplo n.º 2
0
 private static void EndGame()
 {
     Console.WriteLine("Computing post game rewards.");
     manager.CollectPostGameRewards();
     Console.WriteLine("Game is over, computing points");
     manager.ComputePoints();
     Console.WriteLine("These are the total victory points (VP) for each player:");
     foreach (var p in manager.Players)
     {
         Console.WriteLine(string.Format("{0} => {1} VP", p.Name.ToUpper(), p.VictoryPoints));
     }
     Console.WriteLine(string.Format("And the winner is... {0}. Congrats!", manager.Players.OrderByDescending(p => p.VictoryPoints).First().Name.ToUpper()));
 }