コード例 #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));
        }
コード例 #2
0
        public void DealAgeCardsFor3PlayersTest()
        {
            var manager = new GameFlowManager();

            manager.CreateNewPlayer("paul");
            manager.CreateNewPlayer("mary");
            manager.CreateNewPlayer("tracy");
            manager.SetupGame();
            manager.StartAge();
            Assert.IsFalse(manager.Players.Any(p => p.SelectableCards.Count != 7));
            Assert.IsFalse(manager.Players.Any(p => p.SelectableCards.Any(c => c.Age != Age.I)));
        }
コード例 #3
0
        public void SetupGameFor5PlayersTest()
        {
            var manager = new GameFlowManager();

            manager.CreateNewPlayer("maria");
            manager.CreateNewPlayer("joão");
            manager.CreateNewPlayer("josé");
            manager.CreateNewPlayer("ana");
            manager.CreateNewPlayer("pedro");
            manager.SetupGame();
            Assert.AreEqual(5, manager.Players.Count);
            //Number of players X 3 ages X 7 cards per age
            Assert.AreEqual(105, manager.FullDeckOfCards.Count);
            //Base game has 7 wonders - number of players
            Assert.AreEqual(2, manager.WonderCards.Count);
            Assert.AreNotEqual(manager.Players[1].Wonder.Name, manager.Players[3].Wonder.Name);
        }
コード例 #4
0
        public void PlayTurnTest()
        {
            var manager = new GameFlowManager();

            manager.CreateNewPlayer("paul");
            manager.CreateNewPlayer("mary");
            manager.CreateNewPlayer("tracy");
            manager.SetupGame();
            manager.StartAge();
            for (int i = 0; i < 7; i++)
            {
                foreach (var p in manager.Players)
                {
                    p.SelectedCard = p.SelectableCards[0];
                    p.ChosenAction = TurnAction.BuyCard;
                }
                manager.PlayTurn();
                manager.CollectTurnRewards();
                manager.EndTurn();
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: elton1086/SevenWonders
 static void DefinePlayers()
 {
     while (true)
     {
         Console.WriteLine("Please type the name of the players separated by comma (,) or semi-colon (;)");
         var names = Console.ReadLine().Split(new string[] { ";", "," }, StringSplitOptions.RemoveEmptyEntries);
         if (names.Length < 3)
         {
             Console.WriteLine("At least three players to play the game");
             continue;
         }
         if (names.Length > 7)
         {
             Console.WriteLine("No more than seven players to play the game");
             continue;
         }
         foreach (var s in names)
         {
             manager.CreateNewPlayer(s);
         }
         break;
     }
     Console.WriteLine();
 }