Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
BattlePetSpawnMgr.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef BATTLE_PET_SPAWN_MGR_H
7
#define BATTLE_PET_SPAWN_MGR_H
8
9
#include "
Common.h
"
10
11
#include <map>
12
#include <set>
13
#include <vector>
14
15
class
Creature
;
16
17
struct
BattlePetWildPoolTemplate
18
{
19
uint16
Species
= 0;
20
uint32
Entry
= 0;
21
uint8
Max
= 0;
22
uint8
MinLevel
= 1;
23
uint8
MaxLevel
= 1;
24
25
std::map<uint64, uint64>
Replacements
;
26
std::set<uint64>
ReadyForReplacement
;
27
};
28
29
class
BattlePetWildZonePool
30
{
31
public
:
32
void
AddTemplate
(
BattlePetWildPoolTemplate
const
& spawnTemplate);
33
void
Populate
();
34
void
OnCreatureAdded
(
Creature
* creature);
35
void
OnCreatureRemoved
(
Creature
* creature);
36
bool
RemoveReplacement
(
Creature
* replacement);
37
bool
IsReplacement
(
uint64
guid)
const
;
38
39
private
:
40
void
SpawnReplacement
(
uint64
originalGuid,
BattlePetWildPoolTemplate
& spawnTemplate);
41
bool
RemoveReplacement
(
uint64
originalGuid,
BattlePetWildPoolTemplate
& spawnTemplate);
42
43
std::vector<BattlePetWildPoolTemplate>
_templates
;
44
};
45
46
class
BattlePetSpawnMgr
47
{
48
public
:
49
static
BattlePetSpawnMgr
*
instance
();
50
51
void
LoadFromDB
();
52
void
Update
(
uint32
diff);
53
void
OnCreatureAdded
(
Creature
* creature);
54
void
OnCreatureRemoved
(
Creature
* creature);
55
bool
ResolveWildBattle
(
Creature
* creature);
56
bool
IsWildBattlePetReplacement
(
Creature
const
* creature)
const
;
57
58
private
:
59
typedef
std::map<uint32, BattlePetWildZonePool>
BattlePetZonePoolMap
;
60
typedef
std::map<uint32, BattlePetZonePoolMap>
BattlePetMapPoolMap
;
61
62
BattlePetWildZonePool
*
GetZonePool
(
Creature
const
* creature);
63
BattlePetWildZonePool
const
*
GetZonePool
(
Creature
const
* creature)
const
;
64
65
BattlePetMapPoolMap
_mapPools
;
66
uint32
_updateTimer
= 0;
67
};
68
69
#define sBattlePetSpawnMgr BattlePetSpawnMgr::instance()
70
71
#endif
// BATTLE_PET_SPAWN_MGR_H
Common.h
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
uint64
std::uint64_t uint64
Definition
Define.h:76
uint16
std::uint16_t uint16
Definition
Define.h:78
BattlePetSpawnMgr
Definition
BattlePetSpawnMgr.h:47
BattlePetSpawnMgr::_mapPools
BattlePetMapPoolMap _mapPools
Definition
BattlePetSpawnMgr.h:65
BattlePetSpawnMgr::ResolveWildBattle
bool ResolveWildBattle(Creature *creature)
Definition
BattlePetSpawnMgr.cpp:184
BattlePetSpawnMgr::GetZonePool
BattlePetWildZonePool * GetZonePool(Creature const *creature)
Definition
BattlePetSpawnMgr.cpp:206
BattlePetSpawnMgr::BattlePetMapPoolMap
std::map< uint32, BattlePetZonePoolMap > BattlePetMapPoolMap
Definition
BattlePetSpawnMgr.h:60
BattlePetSpawnMgr::OnCreatureAdded
void OnCreatureAdded(Creature *creature)
Definition
BattlePetSpawnMgr.cpp:166
BattlePetSpawnMgr::BattlePetZonePoolMap
std::map< uint32, BattlePetWildZonePool > BattlePetZonePoolMap
Definition
BattlePetSpawnMgr.h:59
BattlePetSpawnMgr::Update
void Update(uint32 diff)
Definition
BattlePetSpawnMgr.cpp:154
BattlePetSpawnMgr::_updateTimer
uint32 _updateTimer
Definition
BattlePetSpawnMgr.h:66
BattlePetSpawnMgr::IsWildBattlePetReplacement
bool IsWildBattlePetReplacement(Creature const *creature) const
Definition
BattlePetSpawnMgr.cpp:195
BattlePetSpawnMgr::OnCreatureRemoved
void OnCreatureRemoved(Creature *creature)
Definition
BattlePetSpawnMgr.cpp:175
BattlePetSpawnMgr::instance
static BattlePetSpawnMgr * instance()
Definition
BattlePetSpawnMgr.cpp:83
BattlePetSpawnMgr::LoadFromDB
void LoadFromDB()
Definition
BattlePetSpawnMgr.cpp:89
BattlePetWildZonePool
Definition
BattlePetSpawnMgr.h:30
BattlePetWildZonePool::OnCreatureAdded
void OnCreatureAdded(Creature *creature)
Definition
BattlePetSpawnMgr.cpp:274
BattlePetWildZonePool::Populate
void Populate()
Definition
BattlePetSpawnMgr.cpp:255
BattlePetWildZonePool::SpawnReplacement
void SpawnReplacement(uint64 originalGuid, BattlePetWildPoolTemplate &spawnTemplate)
Definition
BattlePetSpawnMgr.cpp:333
BattlePetWildZonePool::RemoveReplacement
bool RemoveReplacement(Creature *replacement)
Definition
BattlePetSpawnMgr.cpp:300
BattlePetWildZonePool::_templates
std::vector< BattlePetWildPoolTemplate > _templates
Definition
BattlePetSpawnMgr.h:43
BattlePetWildZonePool::AddTemplate
void AddTemplate(BattlePetWildPoolTemplate const &spawnTemplate)
Definition
BattlePetSpawnMgr.cpp:246
BattlePetWildZonePool::OnCreatureRemoved
void OnCreatureRemoved(Creature *creature)
Definition
BattlePetSpawnMgr.cpp:287
BattlePetWildZonePool::IsReplacement
bool IsReplacement(uint64 guid) const
Definition
BattlePetSpawnMgr.cpp:322
Creature
Definition
Creature.h:427
BattlePetWildPoolTemplate
Definition
BattlePetSpawnMgr.h:18
BattlePetWildPoolTemplate::Max
uint8 Max
Definition
BattlePetSpawnMgr.h:21
BattlePetWildPoolTemplate::MaxLevel
uint8 MaxLevel
Definition
BattlePetSpawnMgr.h:23
BattlePetWildPoolTemplate::Entry
uint32 Entry
Definition
BattlePetSpawnMgr.h:20
BattlePetWildPoolTemplate::Species
uint16 Species
Definition
BattlePetSpawnMgr.h:19
BattlePetWildPoolTemplate::MinLevel
uint8 MinLevel
Definition
BattlePetSpawnMgr.h:22
BattlePetWildPoolTemplate::ReadyForReplacement
std::set< uint64 > ReadyForReplacement
Definition
BattlePetSpawnMgr.h:26
BattlePetWildPoolTemplate::Replacements
std::map< uint64, uint64 > Replacements
Definition
BattlePetSpawnMgr.h:25
src
server
game
BattlePet
BattlePetSpawnMgr.h
Generated on
for Project SkyFire Core by
1.17.0