00001 00031 #ifndef LL_LLECONOMY_H 00032 #define LL_LLECONOMY_H 00033 00034 #include "llmemory.h" 00035 00036 class LLMessageSystem; 00037 class LLVector3; 00038 00039 class LLGlobalEconomy 00040 { 00041 public: 00042 LLGlobalEconomy(); 00043 virtual ~LLGlobalEconomy(); 00044 00045 // This class defines its singleton internally as a typedef instead of inheriting from 00046 // LLSingleton like most others because the LLRegionEconomy sub-class might also 00047 // become a singleton and this pattern will more easily disambiguate them. 00048 typedef LLSingleton<LLGlobalEconomy> Singleton; 00049 00050 virtual void print(); 00051 00052 static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data); 00053 00054 S32 calculateTeleportCost(F32 distance) const; 00055 S32 calculateLightRent(const LLVector3& object_size) const; 00056 00057 S32 getObjectCount() const { return mObjectCount; } 00058 S32 getObjectCapacity() const { return mObjectCapacity; } 00059 S32 getPriceObjectClaim() const { return mPriceObjectClaim; } 00060 S32 getPricePublicObjectDecay() const { return mPricePublicObjectDecay; } 00061 S32 getPricePublicObjectDelete() const { return mPricePublicObjectDelete; } 00062 S32 getPricePublicObjectRelease() const { return mPriceObjectClaim - mPricePublicObjectDelete; } 00063 S32 getPriceEnergyUnit() const { return mPriceEnergyUnit; } 00064 S32 getPriceUpload() const { return mPriceUpload; } 00065 S32 getPriceRentLight() const { return mPriceRentLight; } 00066 S32 getTeleportMinPrice() const { return mTeleportMinPrice; } 00067 F32 getTeleportPriceExponent() const { return mTeleportPriceExponent; } 00068 S32 getPriceGroupCreate() const { return mPriceGroupCreate; } 00069 00070 00071 void setObjectCount(S32 val) { mObjectCount = val; } 00072 void setObjectCapacity(S32 val) { mObjectCapacity = val; } 00073 void setPriceObjectClaim(S32 val) { mPriceObjectClaim = val; } 00074 void setPricePublicObjectDecay(S32 val) { mPricePublicObjectDecay = val; } 00075 void setPricePublicObjectDelete(S32 val) { mPricePublicObjectDelete = val; } 00076 void setPriceEnergyUnit(S32 val) { mPriceEnergyUnit = val; } 00077 void setPriceUpload(S32 val) { mPriceUpload = val; } 00078 void setPriceRentLight(S32 val) { mPriceRentLight = val; } 00079 void setTeleportMinPrice(S32 val) { mTeleportMinPrice = val; } 00080 void setTeleportPriceExponent(F32 val) { mTeleportPriceExponent = val; } 00081 void setPriceGroupCreate(S32 val) { mPriceGroupCreate = val; } 00082 00083 private: 00084 S32 mObjectCount; 00085 S32 mObjectCapacity; 00086 S32 mPriceObjectClaim; // per primitive 00087 S32 mPricePublicObjectDecay; // per primitive 00088 S32 mPricePublicObjectDelete; // per primitive 00089 S32 mPriceEnergyUnit; 00090 S32 mPriceUpload; 00091 S32 mPriceRentLight; 00092 S32 mTeleportMinPrice; 00093 F32 mTeleportPriceExponent; 00094 S32 mPriceGroupCreate; 00095 }; 00096 00097 00098 class LLRegionEconomy : public LLGlobalEconomy 00099 { 00100 public: 00101 LLRegionEconomy(); 00102 ~LLRegionEconomy(); 00103 00104 static void processEconomyData(LLMessageSystem *msg, void **user_data); 00105 static void processEconomyDataRequest(LLMessageSystem *msg, void **user_data); 00106 00107 void print(); 00108 00109 BOOL hasData() const; 00110 F32 getPriceObjectRent() const { return mPriceObjectRent; } 00111 F32 getPriceObjectScaleFactor() const {return mPriceObjectScaleFactor;} 00112 F32 getEnergyEfficiency() const { return mEnergyEfficiency; } 00113 S32 getPriceParcelClaim() const; 00114 S32 getPriceParcelRent() const; 00115 F32 getAreaOwned() const { return mAreaOwned; } 00116 F32 getAreaTotal() const { return mAreaTotal; } 00117 S32 getBasePriceParcelClaimActual() const { return mBasePriceParcelClaimActual; } 00118 00119 void setPriceObjectRent(F32 val) { mPriceObjectRent = val; } 00120 void setPriceObjectScaleFactor(F32 val) { mPriceObjectScaleFactor = val; } 00121 void setEnergyEfficiency(F32 val) { mEnergyEfficiency = val; } 00122 00123 void setBasePriceParcelClaimDefault(S32 val); 00124 void setBasePriceParcelClaimActual(S32 val); 00125 void setPriceParcelClaimFactor(F32 val); 00126 void setBasePriceParcelRent(S32 val); 00127 00128 void setAreaOwned(F32 val) { mAreaOwned = val; } 00129 void setAreaTotal(F32 val) { mAreaTotal = val; } 00130 00131 private: 00132 F32 mPriceObjectRent; 00133 F32 mPriceObjectScaleFactor; 00134 F32 mEnergyEfficiency; 00135 00136 S32 mBasePriceParcelClaimDefault; 00137 S32 mBasePriceParcelClaimActual; 00138 F32 mPriceParcelClaimFactor; 00139 S32 mBasePriceParcelRent; 00140 00141 F32 mAreaOwned; 00142 F32 mAreaTotal; 00143 00144 }; 00145 00146 #endif