Cuberite
A lightweight, fast and extensible game server for Minecraft
|
This class is used to collect information, for each Mob, what is the distance of the closest player it was first being designed in order to make mobs spawn / despawn / act as the behaviour and even life of mobs depends on the distance to closest player. More...
#include <MobCensus.h>
Public Member Functions | |
void | CollectMob (cMonster &a_Monster, cChunk &a_Chunk, double a_Distance) |
Collect a mob - its distance to player, its family ... More... | |
void | CollectSpawnableChunk (cChunk &a_Chunk) |
cMobProximityCounter & | GetProximityCounter (void) |
Returns the nested proximity counter. More... | |
bool | IsCapped (cMonster::eFamily a_MobFamily) |
Returns true if the family is capped (i.e. More... | |
void | Logd (void) |
log the results of census to server console More... | |
Protected Member Functions | |
int | GetNumChunks () |
Returns the number of chunks that are elligible for spawning (for now, the loaded, valid chunks) More... | |
Static Protected Member Functions | |
static int | GetCapMultiplier (cMonster::eFamily a_MobFamily) |
Returns the cap multiplier value of the given monster family. More... | |
Protected Attributes | |
std::set< cChunk * > | m_EligibleForSpawnChunks |
cMobFamilyCollecter | m_MobFamilyCollecter |
cMobProximityCounter | m_ProximityCounter |
This class is used to collect information, for each Mob, what is the distance of the closest player it was first being designed in order to make mobs spawn / despawn / act as the behaviour and even life of mobs depends on the distance to closest player.
as side effect : it also collect the chunks that are elligible for spawning as side effect 2 : it also know the caps for mobs number and can compare census to this numbers
Definition at line 25 of file MobCensus.h.
Collect a mob - its distance to player, its family ...
Definition at line 10 of file MobCensus.cpp.
void cMobCensus::CollectSpawnableChunk | ( | cChunk & | a_Chunk | ) |
Definition at line 53 of file MobCensus.cpp.
|
staticprotected |
Returns the cap multiplier value of the given monster family.
Definition at line 33 of file MobCensus.cpp.
|
protected |
Returns the number of chunks that are elligible for spawning (for now, the loaded, valid chunks)
Definition at line 62 of file MobCensus.cpp.
cMobProximityCounter & cMobCensus::GetProximityCounter | ( | void | ) |
Returns the nested proximity counter.
Definition at line 71 of file MobCensus.cpp.
bool cMobCensus::IsCapped | ( | cMonster::eFamily | a_MobFamily | ) |
Returns true if the family is capped (i.e.
there are more mobs of this family than max)
Definition at line 20 of file MobCensus.cpp.
void cMobCensus::Logd | ( | void | ) |
log the results of census to server console
Definition at line 80 of file MobCensus.cpp.
|
protected |
Definition at line 48 of file MobCensus.h.
|
protected |
Definition at line 46 of file MobCensus.h.
|
protected |
Definition at line 45 of file MobCensus.h.