Пример #1
0
        public void ComputePointsByManyTypesTest()
        {
            players[0].Wonder.BuildStage();
            players[0].Cards.Add(cards.First(c => c.Name == CardName.ChamberOfCommerce));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Glassworks));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Press));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.TimberYard));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Lighthouse));

            players[1].Wonder.BuildStage();
            players[1].Wonder.BuildStage();
            players[1].Cards.Add(cards.First(c => c.Name == CardName.ChamberOfCommerce));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Glassworks));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.TimberYard));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Arena));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Haven));

            players[2].Wonder.BuildStage();
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Lighthouse));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Arena));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Forum));

            var pointsCategory = new CommercialStructuresCategory();

            pointsCategory.ComputePoints(players);

            //4 for manufactured cards, 2 for commercial cards
            Assert.AreEqual(6, players[0].VictoryPoints);
            //2 for manufacured cards, 2 for wonder stages, 1 for raw material cards
            Assert.AreEqual(5, players[1].VictoryPoints);
            //3 for commercial cards, 1 for wonder stages
            Assert.AreEqual(4, players[2].VictoryPoints);
        }
Пример #2
0
        public void ComputePointsByWonderStageBuiltTest()
        {
            players[0].Wonder.BuildStage();
            players[1].Wonder.BuildStage();
            players[1].Wonder.BuildStage();

            players[1].Cards.Add(cards.First(c => c.Name == CardName.Arena));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Arena));

            var pointsCategory = new CommercialStructuresCategory();

            pointsCategory.ComputePoints(players);

            Assert.AreEqual(0, players[0].VictoryPoints);
            Assert.AreEqual(2, players[1].VictoryPoints);
            Assert.AreEqual(0, players[2].VictoryPoints);
        }
Пример #3
0
        public GamePointsManager()
        {
            pointsCategory = new TreasuryContentsCategory();
            var military   = new MilitaryConflictsCategory();
            var wonder     = new WonderCategory();
            var civilian   = new CivilianStructuresCategory();
            var scientific = new ScientificStructuresCategory();
            var commercial = new CommercialStructuresCategory();
            var guilds     = new GuildsCategory();

            pointsCategory.SetSuccessor(military);
            military.SetSuccessor(wonder);
            wonder.SetSuccessor(civilian);
            civilian.SetSuccessor(scientific);
            scientific.SetSuccessor(commercial);
            commercial.SetSuccessor(guilds);
        }
Пример #4
0
        public void ComputePointsByManufacturedGoodTest()
        {
            players[0].Cards.Add(cards.First(c => c.Name == CardName.ChamberOfCommerce));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Glassworks));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Press));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.ChamberOfCommerce));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Glassworks));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.TimberYard));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Press));

            var pointsCategory = new CommercialStructuresCategory();

            pointsCategory.ComputePoints(players);

            Assert.AreEqual(4, players[0].VictoryPoints);
            Assert.AreEqual(2, players[1].VictoryPoints);
            Assert.AreEqual(0, players[2].VictoryPoints);
        }
Пример #5
0
        public void ComputePointsByRawMaterialTest()
        {
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Haven));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.TimberYard));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.LumberYard));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Haven));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Glassworks));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Forum));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.TimberYard));

            var pointsCategory = new CommercialStructuresCategory();

            pointsCategory.ComputePoints(players);

            Assert.AreEqual(2, players[0].VictoryPoints);
            Assert.AreEqual(0, players[1].VictoryPoints);
            Assert.AreEqual(0, players[2].VictoryPoints);
        }
Пример #6
0
        public void ComputePointsByCommercialTest()
        {
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Lighthouse));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.Forum));
            players[0].Cards.Add(cards.First(c => c.Name == CardName.LumberYard));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Haven));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.Forum));
            players[1].Cards.Add(cards.First(c => c.Name == CardName.ChamberOfCommerce));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Lighthouse));
            players[2].Cards.Add(cards.First(c => c.Name == CardName.Forum));

            var pointsCategory = new CommercialStructuresCategory();

            pointsCategory.ComputePoints(players);

            Assert.AreEqual(2, players[0].VictoryPoints);
            Assert.AreEqual(0, players[1].VictoryPoints);
            Assert.AreEqual(2, players[2].VictoryPoints);
        }