EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BeltMgr.h
Go to the documentation of this file.
1 
12 #ifndef EVEMU_SYSTEM_BELTMGR_H_
13 #define EVEMU_SYSTEM_BELTMGR_H_
14 
15 #include <unordered_map>
16 #include "system/Asteroid.h"
17 #include "system/SystemEntity.h"
19 
20 /* this class will keep track of all asteroid belts in a system
21  * it is created on a per-system basis, and will also deal with
22  * calling spawn/delete/grow functions for each belt.
23  *
24  * this class will also be in charge of belts in anomalies
25  *
26  * a new iteration of this class is created for each system as that system
27  * is booted.
28  */
29 
30 
31 class PyServiceMgr;
32 class SystemManager;
33 
34 class BeltMgr
35 {
36 public:
38  ~BeltMgr() { /* do nothing here */ }
39 
40  void Init(uint32 regionID);
41  void Save();
42  void Process();
43  void ClearAll();
44  void ClearBelt(uint16 bubbleID);
45  void SetActive(uint16 bubbleID, bool active=true);
46  void RegisterBelt(InventoryItemRef itemRef);
47  bool Create(CosmicSignature& sig, std::unordered_multimap<float, uint16>& roidTypes);
48 
49  bool Load(uint16 bubbleID);
50  bool IsActive(uint16 bubbleID);
51  bool IsSpawned(uint16 bubbleID);
52  void CheckSpawn(uint16 bubbleID);
53 
54  void GetList(uint32 beltID, std::vector< AsteroidSE* >& list);
55 
56  void RemoveAsteroid(uint32 beltID, AsteroidSE* pASE);
57 
58 protected:
61 
62  void SpawnBelt(uint16 bubbleID, std::unordered_multimap<float, uint16>& roidTypes, int type = 0, bool anomaly = false);
63  void SpawnAsteroid(uint32 beltID, uint32 typeID, double radius, const GPoint& position, bool ice=false);
64  void GetIceDist(uint8 quarter, float secStatus, std::unordered_multimap<float, uint16>& roidDist);
65 
66  uint32 GetAsteroidType(double p, const std::unordered_multimap<float, uint16>& roids);
67 
68 private:
69  SystemManager* m_system; //we do not own this
70  PyServiceMgr& m_services; //we do not own this
71 
75 
76  /* map contains beltID, boolean for IsSpawned() */
77  std::map<uint32, bool> m_spawned;
78  /* map contains beltID, boolean for IsActive() */
79  std::map<uint32, bool> m_active;
80  /* vector contains belt's itemID, itemRef */
81  std::map<uint32, InventoryItemRef> m_belts;
82  /* this map contains beltID, asteroidSE for entire system */
83  std::unordered_multimap<uint32, AsteroidSE*> m_asteroids;
84 
85 };
86 
87 #endif // EVEMU_SYSTEM_BELTMGR_H_
88 
89 
90 /* data for sovereign nullsec systems that contain an active Ore Prospecting Array.
91  Small Asteroid Cluster
92 Arkonor 9600
93 Bistot 12800
94 Crokite 30000
95 Dark Ochre 16000
96 Gneiss 170000
97 Spodumain 300000
98 
99  Medium Asteroid Cluster
100 Arkonor 28000
101 Bistot 38700
102 Crokite 84700
103 Dark Ochre 31000
104 Gneiss 340000
105 Spodumain 270000
106 Mercoxit 2600
107 
108  Large Asteroid Cluster
109 Arkonor 29900
110 Bistot 57000
111 Crokite 124000
112 Dark Ochre 60000
113 Gneiss 313500
114 Spodumain 368100
115 Mercoxit 3500
116 
117  Enormous Asteroid Cluster
118 Arkonor 58000
119 Bistot 86000
120 Crokite 169000
121 Dark Ochre 50000
122 Gneiss 540000
123 Spodumain 542000
124 Mercoxit 5200
125 
126  Colossal Asteroid Cluster
127 Arkonor 60800
128 Bistot 114300
129 Crokite 225200
130 Dark Ochre 115000
131 Gneiss 630000
132 Spodumain 736200
133 Mercoxit 7000
134 
135 */
unsigned __int8 uint8
Definition: eve-compat.h:46
std::map< uint32, bool > m_active
Definition: BeltMgr.h:79
bool Load(uint16 bubbleID)
Definition: BeltMgr.cpp:139
void Init(uint32 regionID)
Definition: BeltMgr.cpp:36
void ClearAll()
Definition: BeltMgr.cpp:71
void Save()
Definition: BeltMgr.cpp:187
void GetList(uint32 beltID, std::vector< AsteroidSE * > &list)
Definition: BeltMgr.cpp:221
bool Create(CosmicSignature &sig, std::unordered_multimap< float, uint16 > &roidTypes)
Definition: BeltMgr.cpp:244
void Process()
Definition: BeltMgr.cpp:125
ManagerDB m_db
Definition: BeltMgr.h:59
bool IsActive(uint16 bubbleID)
Definition: BeltMgr.cpp:105
std::map< uint32, InventoryItemRef > m_belts
Definition: BeltMgr.h:81
PyServiceMgr & m_services
Definition: BeltMgr.h:70
uint32 m_systemID
Definition: BeltMgr.h:73
std::unordered_multimap< uint32, AsteroidSE * > m_asteroids
Definition: BeltMgr.h:83
Definition: gpoint.h:33
bool IsSpawned(uint16 bubbleID)
Definition: BeltMgr.cpp:96
SystemManager * m_system
Definition: BeltMgr.h:69
BeltMgr(SystemManager *mgr, PyServiceMgr &svc)
Definition: BeltMgr.cpp:28
bool m_initialized
Definition: BeltMgr.h:72
void SpawnBelt(uint16 bubbleID, std::unordered_multimap< float, uint16 > &roidTypes, int type=0, bool anomaly=false)
Definition: BeltMgr.cpp:255
unsigned __int32 uint32
Definition: eve-compat.h:50
void ClearBelt(uint16 bubbleID)
Definition: BeltMgr.cpp:66
void RemoveAsteroid(uint32 beltID, AsteroidSE *pASE)
Definition: BeltMgr.cpp:424
void SetActive(uint16 bubbleID, bool active=true)
Definition: BeltMgr.cpp:114
~BeltMgr()
Definition: BeltMgr.h:38
void SpawnAsteroid(uint32 beltID, uint32 typeID, double radius, const GPoint &position, bool ice=false)
Definition: BeltMgr.cpp:375
std::map< uint32, bool > m_spawned
Definition: BeltMgr.h:77
Definition: timer.h:30
void RegisterBelt(InventoryItemRef itemRef)
Definition: BeltMgr.cpp:57
uint32 GetAsteroidType(double p, const std::unordered_multimap< float, uint16 > &roids)
Definition: BeltMgr.cpp:362
unsigned __int16 uint16
Definition: eve-compat.h:48
uint32 m_regionID
Definition: BeltMgr.h:74
void GetIceDist(uint8 quarter, float secStatus, std::unordered_multimap< float, uint16 > &roidDist)
Definition: BeltMgr.cpp:446
Timer m_respawnTimer
Definition: BeltMgr.h:60
void CheckSpawn(uint16 bubbleID)
Definition: BeltMgr.cpp:82