public GameState TradeBank(Player player, Resource giving, Resource receiving)
{
if (resourceBank[(int)receiving] == 0)
throw new NoMoreCardsException("Resource bank has no more resources of type " + receiving);
var harbors = board.GetPlayersHarbors(player.Id);
var hasSpecific = harbors.Contains((HarborType) giving);
var hasGeneral = harbors.Contains(HarborType.ThreeForOne);
var amountToGive = (hasSpecific) ? 2 : ((hasGeneral) ? 3 : 4);
if (player.Resources.Count(r => r == giving) < amountToGive)
throw new InsufficientResourcesException("Player hasn't got enough resources to trade");
PayResource(player,giving,amountToGive);
GetResource(player,receiving);
Log(new TradeBankLogEvent(player.Id,giving,amountToGive,receiving));
return CurrentGamestate();
}