* @param amount The amount of goods to buy.
     * @param random A <code>Random</code> number source.
     * @throws IllegalStateException If the <code>player</code> cannot afford
     *                               to buy the goods.
     */
    public void buy(GoodsContainer container, GoodsType type, int amount,
                    Random random)
        throws IllegalStateException {
        logger.finest(getName() + " buys " + amount + " " + type);
        Market market = getMarket();
        int price = market.getBidPrice(type, amount);
        if (!checkGold(price)) {
            throw new IllegalStateException("Player " + getName()
                + " tried to buy " + Integer.toString(amount)
                + " " + type.toString()
                + " for " + Integer.toString(price)
                + " but has " + Integer.toString(getGold()) + " gold.");
        }
        modifyGold(-price);
        market.modifySales(type, -amount);
        market.modifyIncomeBeforeTaxes(type, -price);
        market.modifyIncomeAfterTaxes(type, -price);
        int marketAmount = -(int)applyModifier((float)amount,
                                               "model.modifier.tradeBonus",
                                               type, getGame().getTurn());
        market.addGoodsToMarket(type, marketAmount);
        propagateToEuropeanMarkets(type, marketAmount, random);

        container.addGoods(type, amount);
    }