summaryrefslogtreecommitdiff
path: root/indra/llinventory/lleconomy.h
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-11-11 01:37:41 +0200
committerVadim ProductEngine <vsavchuk@productengine.com>2011-11-11 01:37:41 +0200
commit4005a820f26d4287bf5c14ec011d4f792c5b82bc (patch)
treec812b4c6111acc0b8f7e0acc654b1791c9b05d3c /indra/llinventory/lleconomy.h
parentd1d8ae974c7dc65f9de40e6caf4edf9a1b7442cb (diff)
EXP-1563 FIXED Negative upload cost displayed on the "Save to My Inventory" button.
Update upload cost in the button label when economy data arrives from server.
Diffstat (limited to 'indra/llinventory/lleconomy.h')
-rw-r--r--indra/llinventory/lleconomy.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h
index cc6643f955..eb2ecf71ba 100644
--- a/indra/llinventory/lleconomy.h
+++ b/indra/llinventory/lleconomy.h
@@ -31,6 +31,16 @@
class LLMessageSystem;
class LLVector3;
+/**
+ * Register an observer to be notified of economy data updates coming from server.
+ */
+class LLEconomyObserver
+{
+public:
+ virtual ~LLEconomyObserver() {}
+ virtual void onEconomyDataChange() = 0;
+};
+
class LLGlobalEconomy
{
public:
@@ -46,6 +56,10 @@ public:
virtual void print();
+ void addObserver(LLEconomyObserver* observer);
+ void removeObserver(LLEconomyObserver* observer);
+ void notifyObservers();
+
static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
S32 calculateTeleportCost(F32 distance) const;
@@ -89,6 +103,8 @@ private:
S32 mTeleportMinPrice;
F32 mTeleportPriceExponent;
S32 mPriceGroupCreate;
+
+ std::list<LLEconomyObserver*> mObservers;
};