Cuberite
A lightweight, fast and extensible game server for Minecraft
MobCensus.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "MobProximityCounter.h"
5 #include "MobFamilyCollecter.h"
6 
7 
8 
9 
10 // fwd:
11 class cChunk;
12 class cMonster;
13 
14 
15 
16 
17 
26 {
27 public:
30 
31  // collect an elligible Chunk for Mob Spawning
32  // MG TODO : code the correct rule (not loaded chunk but short distant from players)
33  void CollectSpawnableChunk(cChunk & a_Chunk);
34 
36  void CollectMob(cMonster & a_Monster, cChunk & a_Chunk, double a_Distance);
37 
39  bool IsCapped(cMonster::eFamily a_MobFamily);
40 
42  void Logd(void);
43 
44 protected :
47 
48  std::set<cChunk *> m_EligibleForSpawnChunks;
49 
51  int GetNumChunks();
52 
54  static int GetCapMultiplier(cMonster::eFamily a_MobFamily);
55 } ;
56 
57 
58 
59 
Definition: Chunk.h:36
This class is used to collect information, for each Mob, what is the distance of the closest player i...
Definition: MobCensus.h:26
bool IsCapped(cMonster::eFamily a_MobFamily)
Returns true if the family is capped (i.e.
Definition: MobCensus.cpp:20
int GetNumChunks()
Returns the number of chunks that are elligible for spawning (for now, the loaded,...
Definition: MobCensus.cpp:62
cMobProximityCounter & GetProximityCounter(void)
Returns the nested proximity counter.
Definition: MobCensus.cpp:71
static int GetCapMultiplier(cMonster::eFamily a_MobFamily)
Returns the cap multiplier value of the given monster family.
Definition: MobCensus.cpp:33
void CollectSpawnableChunk(cChunk &a_Chunk)
Definition: MobCensus.cpp:53
std::set< cChunk * > m_EligibleForSpawnChunks
Definition: MobCensus.h:48
cMobProximityCounter m_ProximityCounter
Definition: MobCensus.h:45
cMobFamilyCollecter m_MobFamilyCollecter
Definition: MobCensus.h:46
void CollectMob(cMonster &a_Monster, cChunk &a_Chunk, double a_Distance)
Collect a mob - its distance to player, its family ...
Definition: MobCensus.cpp:10
void Logd(void)
log the results of census to server console
Definition: MobCensus.cpp:80
This class is used to collect the list of mobs for each family.