Esempio n. 1
0
    private void SellTradeOffer(int tradeAcceptant, int resourceID, int amount)
    {
        resourcesAmountForTrade[resourceID] -= amount;
        if (resourcesAmountForTrade[resourceID] < 0)
        {
            resourcesAmountForTrade[resourceID] = 0;
        }

        float      value      = resourcesCostForTrade[resourceID] * amount;
        TradeOffer tradeOffer = new TradeOffer(this, resourceID, amount, value);

        MarketPlace.OnTradeOfferSold(tradeOffer);
        if (isLocalPlayer)
        {
            EventLogManager.AddNewTradeOfferSoldLog(tradeOffer);
        }
    }