--- a/src/economy_new.h Tue Mar 13 15:46:40 2007 +0000
+++ b/src/economy_new.h Tue Mar 13 16:04:23 2007 +0000
@@ -12,12 +12,19 @@
#include "functions.h" // RandomRange
/**
+ * A Base Class used for economic entities in the game that use an activity level
+ */
+class EconomicObject {
+protected:
+ FixedT<int64, 16> m_activity_level; ///< Economic Activity Level, an indicator for the GDP per capita of the map
+};
+
+/**
* Handles all the economic data and events
*/
-class CEconomy {
+class CEconomy : EconomicObject {
private:
FixedT<int32, 16> m_basic_growth; ///< Basic growth number, depends solely on difficulty setting
- FixedT<int64, 16> m_activity_level; ///< Economic Activity Level, an indicator for the GDP per capita of the map
byte m_long_term_cycle; ///< The period of the long-term cycle suggested by Kondratiev
byte m_short_term_cycle; ///< The period of the short-term cycle (see Juglar, others)
FixedT<int32, 16> m_long_term_ampl; ///< Amplitude of the long-term cycle
@@ -92,6 +99,7 @@
DEBUG(eco, 5, "Added a random event with a value of %f, adjusted EAL to %f", (double)mod, (double)m_activity_level);
}
+private:
/**
* Computes the modification of economic growth by cyclic events
* @return The growth modification