private void ExecuteBonusProduction(BonusProduction bonusProduction, IPlayer player) { if (!_isProducedByRoleOwner[bonusProduction.GoodType]) { throw new GameException($"{bonusProduction.GoodType} was not produced"); } var zeroOrOneGoodList = Game.Goods.Where(g => g.Type == bonusProduction.GoodType).Take(1).ToList(); Game.Goods.RemoveAll(zeroOrOneGoodList.Contains); player.AddGoods(zeroOrOneGoodList); SetPlayerPhase(player, EndedPhase); }
public void CanUsePrivilege() { var action = new BonusProduction { GoodType = GoodType.Corn }; var plantation = new CornPlantation(); plantation.AddWorker(new Colonist()); RoleOwner.Plant(plantation); ReselectRole(); CanExecuteActionOnce(action, RoleOwner); }