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