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); }
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); } }