EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Planet.h
Go to the documentation of this file.
1 
12 #ifndef EVEMU_PLANET_PLANET_H_
13 #define EVEMU_PLANET_PLANET_H_
14 
15 #include "EntityList.h"
16 #include "StaticDataMgr.h"
17 #include "system/SystemEntity.h"
18 
20 class Planet
21 {
22 public:
23  Planet();
24  ~Planet() { /* do nothing here */ }
25 
26 protected:
27 private:
28 
29 };
30 
31 
32 class Colony;
33 class PyServiceMgr;
34 class SystemManager;
35 class CustomsSE;
36 class Call_ResourceDataDict;
37 
38 class PlanetSE
39 : public StaticSystemEntity
40 {
41 public:
43  virtual ~PlanetSE();
44 
45  /* Process Calls - Overridden as needed in derived classes */
46  virtual void Process();
47 
48  /* class type pointer querys. */
49  virtual PlanetSE* GetPlanetSE() { return this; }
50  /* class type tests. */
51  virtual bool IsPlanetSE() { return true; }
52 
53  /* virtual functions default to base class and overridden as needed */
54  virtual bool LoadExtras();
55 
56  /* specific functions for this class */
57  PyRep* GetPlanetInfo(Colony* pColony);
58  PyRep* GetResourceData(Call_ResourceDataDict& dict);
61 
62  void AbandonColony(Colony* pColony);
63  Colony* GetColony(Client* pClient);
64 
65  bool HasCOSE() { return pCO != nullptr; }
66  void CreateCustomsOffice();
67  void SetCustomsOffice(CustomsSE* pSE){ pCO = pSE; }
69 
70  bool HasColony() { return !m_colonies.empty(); }
71 
72 protected:
73  CustomsSE* pCO; // our Customs Office SE - we dont own this
75 
76 private:
77  std::map<uint16, std::string> m_typeBuffers;
78 
79  /* map of charID, Colony* for this planet.
80  * this is a hack, as the client will not reuse planet bound objects, instead calling for a new object on every call.
81  * this scheme will prevent data races on colony calls
82  * Colony* is owned by its planetSE
83  */
84  std::map<uint32, Colony*> m_colonies;
85 
86 
87 };
88 
89 #endif // EVEMU_PLANET_PLANET_H_
90 
91 
92 /*
93  minBand, maxBand = const.planetResourceProximityLimits[info.proximity]
94  info.newBand = min(maxBand, minBand + info.planetology + info.advancedPlanetology * 2)
95  requiredSkill = 5 - info.proximity
96  if info.remoteSensing < requiredSkill:
97  info.requiredSkill = requiredSkill
98  for i, scanRange in enumerate(const.planetResourceScanningRanges):
99  if scanRange >= dist:
100  info.proximity = i
101 
102 planetResourceScanDistance = 1000000000
103 
104 planetResourceProximityDistant = 0
105 planetResourceProximityRegion = 1
106 planetResourceProximityConstellation = 2
107 planetResourceProximitySystem = 3
108 planetResourceProximityPlanet = 4
109 
110 planetResourceProximityLimits =
111 [(2, 6),
112  (4, 10),
113  (6, 15),
114  (10, 20),
115  (15, 30)]
116 planetResourceScanningRanges =
117 [9.0,
118  7.0,
119  5.0,
120  3.0,
121  1.0]
122 planetResourceUpdateTime = 1 * HOUR
123 
124 planetResourceMaxValue = 1.21
125 MAX_DISPLAY_QUALTY = const.planetResourceMaxValue * 255 * 0.5
126 qualityRemapped = quality / MAX_DISPLAY_QUALTY
127 self.resourceList.AddItem(typeID, quality=max(0, min(1.0, qualityRemapped)))
128 
129 */
Base Python wire object.
Definition: PyRep.h:66
PlanetSE(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
Definition: Planet.cpp:45
PlanetResourceData m_data
Definition: Planet.h:74
void AbandonColony(Colony *pColony)
Definition: Planet.cpp:266
void SetCustomsOffice(CustomsSE *pSE)
Definition: Planet.h:67
CustomsSE * GetCustomsOffice()
Definition: Planet.h:68
virtual PlanetSE * GetPlanetSE()
Definition: Planet.h:49
Definition: Planet.h:20
virtual bool IsPlanetSE()
Definition: Planet.h:51
PyRep * GetResourceData(Call_ResourceDataDict &dict)
Definition: Planet.cpp:136
bool HasColony()
Definition: Planet.h:70
PyRep * GetPlanetResourceInfo()
Definition: Planet.cpp:196
signed __int32 int32
Definition: eve-compat.h:49
Definition: Colony.h:38
virtual bool LoadExtras()
Definition: Planet.cpp:60
bool HasCOSE()
Definition: Planet.h:65
Definition: Client.h:66
virtual void Process()
Definition: Planet.cpp:130
virtual ~PlanetSE()
Definition: Planet.cpp:52
void CreateCustomsOffice()
Definition: Planet.cpp:272
~Planet()
Definition: Planet.h:24
Colony * GetColony(Client *pClient)
Definition: Planet.cpp:255
PyRep * GetPlanetInfo(Colony *pColony)
Definition: Planet.cpp:209
std::map< uint16, std::string > m_typeBuffers
Definition: Planet.h:77
CustomsSE * pCO
Definition: Planet.h:73
PyRep * GetExtractorsForPlanet(int32 planetID)
Definition: Planet.cpp:230
Planet()
Definition: Planet.cpp:39
std::map< uint32, Colony * > m_colonies
Definition: Planet.h:84