Ejemplo n.º 1
0
        public void CanUseWharf()
        {
            var player = GetPlayerWithoutPrivilege();
            var wharf  = new Wharf();

            wharf.AddWorker(new Colonist());
            player.Buildings.Add(wharf);

            var goodCount = 9;

            for (var i = 0; i < goodCount; i++)
            {
                player.Goods.Add(new Indigo());
            }

            ReselectRole();
            var useWharf = new UseWharf {
                GoodType = GoodType.Indigo
            };

            CanExecuteActionOnce(useWharf, player);

            Assert.Empty(player.Goods);
            Assert.Equal(goodCount, player.VictoryPointChips.Count);
        }
Ejemplo n.º 2
0
        private void ExecuteUseWharf(UseWharf useWharf, IPlayer player)
        {
            _isWharfUsedBy[player.UserId] = true;
            var deliveredGoods = player.Goods.Where(g => g.Type == useWharf.GoodType).ToList();

            DoDeliver(deliveredGoods, player);
            Game.Goods.AddRange(deliveredGoods);
            if (IsAbleToUseCargoShip(player))
            {
                MoveToNextPlayer();
            }
            else if (player.Goods.Count > 0)
            {
                SetPlayerPhase(player, StorePhase);
            }
            else
            {
                SetPlayerPhase(player, EndedPhase);
            }
        }