public void Sell() { Economy.EconomyType thisType = Economy.getTypeForConfig(_config); int currentAmount = GameState.sharedState.currentEconomy.getValueForType(thisType); int marketValue = currentAmount * _config._maxMarketValue; //TODO: this should be refactored... Economy economy = new Economy(); economy.AddForEconomyType(thisType, currentAmount); economy.AddForEconomyType(Economy.EconomyType.GOLD, -marketValue); GameState.sharedState.Purchase(economy); _parent.RefreshAllOffers(); }