TrinityCore
Loading...
Searching...
No Matches
InstanceSave Class Reference

#include <InstanceSaveMgr.h>

Public Types

typedef std::list< Player * > PlayerListType
 
typedef std::list< Group * > GroupListType
 

Public Member Functions

 InstanceSave (uint16 MapId, uint32 InstanceId, Difficulty difficulty, time_t resetTime, bool canReset)
 
 ~InstanceSave ()
 
uint8 GetPlayerCount () const
 
uint8 GetGroupCount () const
 
uint32 GetInstanceId () const
 
uint32 GetMapId () const
 
void SaveToDB ()
 
void DeleteFromDB ()
 
time_t GetResetTime () const
 
void SetResetTime (time_t resetTime)
 
time_t GetResetTimeForDB ()
 
InstanceTemplate const * GetTemplate ()
 
MapEntry const * GetMapEntry ()
 
void AddPlayer (Player *player)
 
bool RemovePlayer (Player *player)
 
void AddGroup (Group *group)
 
bool RemoveGroup (Group *group)
 
bool CanReset () const
 
void SetCanReset (bool canReset)
 
Difficulty GetDifficulty () const
 

Private Member Functions

bool UnloadIfEmpty ()
 
void SetToDelete (bool toDelete)
 

Private Attributes

PlayerListType m_playerList
 
GroupListType m_groupList
 
time_t m_resetTime
 
uint32 m_instanceid
 
uint32 m_mapid
 
Difficulty m_difficulty
 
bool m_canReset
 
bool m_toDelete
 
std::mutex _playerListLock
 

Friends

class InstanceSaveManager
 

Detailed Description

Definition at line 43 of file InstanceSaveMgr.h.

Member Typedef Documentation

◆ GroupListType

typedef std::list<Group*> InstanceSave::GroupListType

Definition at line 123 of file InstanceSaveMgr.h.

◆ PlayerListType

typedef std::list<Player*> InstanceSave::PlayerListType

Definition at line 122 of file InstanceSaveMgr.h.

Constructor & Destructor Documentation

◆ InstanceSave()

InstanceSave::InstanceSave ( uint16  MapId,
uint32  InstanceId,
Difficulty  difficulty,
time_t  resetTime,
bool  canReset 
)

Definition at line 181 of file InstanceSaveMgr.cpp.

◆ ~InstanceSave()

InstanceSave::~InstanceSave ( )

Definition at line 185 of file InstanceSaveMgr.cpp.

Member Function Documentation

◆ AddGroup()

void InstanceSave::AddGroup ( Group group)
inline

Definition at line 102 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ AddPlayer()

void InstanceSave::AddPlayer ( Player player)
inline

Definition at line 82 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ CanReset()

bool InstanceSave::CanReset ( ) const
inline

Definition at line 115 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ DeleteFromDB()

void InstanceSave::DeleteFromDB ( )

Definition at line 242 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDifficulty()

Difficulty InstanceSave::GetDifficulty ( ) const
inline

Definition at line 120 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetGroupCount()

uint8 InstanceSave::GetGroupCount ( ) const
inline

Definition at line 58 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetInstanceId()

uint32 InstanceSave::GetInstanceId ( ) const
inline

Definition at line 63 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetMapEntry()

MapEntry const * InstanceSave::GetMapEntry ( )

Definition at line 237 of file InstanceSaveMgr.cpp.

◆ GetMapId()

uint32 InstanceSave::GetMapId ( ) const
inline

Definition at line 64 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetPlayerCount()

uint8 InstanceSave::GetPlayerCount ( ) const
inline

Definition at line 57 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetResetTime()

time_t InstanceSave::GetResetTime ( ) const
inline

Definition at line 73 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ GetResetTimeForDB()

time_t InstanceSave::GetResetTimeForDB ( )

Definition at line 221 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTemplate()

InstanceTemplate const * InstanceSave::GetTemplate ( )

Definition at line 232 of file InstanceSaveMgr.cpp.

◆ RemoveGroup()

bool InstanceSave::RemoveGroup ( Group group)
inline

Definition at line 103 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ RemovePlayer()

bool InstanceSave::RemovePlayer ( Player player)
inline

Definition at line 88 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ SaveToDB()

void InstanceSave::SaveToDB ( )

Definition at line 194 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCanReset()

void InstanceSave::SetCanReset ( bool  canReset)
inline

Definition at line 116 of file InstanceSaveMgr.h.

+ Here is the caller graph for this function:

◆ SetResetTime()

void InstanceSave::SetResetTime ( time_t  resetTime)
inline

Definition at line 74 of file InstanceSaveMgr.h.

◆ SetToDelete()

void InstanceSave::SetToDelete ( bool  toDelete)
inlineprivate

Definition at line 127 of file InstanceSaveMgr.h.

◆ UnloadIfEmpty()

bool InstanceSave::UnloadIfEmpty ( )
private

Definition at line 248 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ InstanceSaveManager

friend class InstanceSaveManager
friend

Definition at line 45 of file InstanceSaveMgr.h.

Member Data Documentation

◆ _playerListLock

std::mutex InstanceSave::_playerListLock
private

Definition at line 144 of file InstanceSaveMgr.h.

◆ m_canReset

bool InstanceSave::m_canReset
private

Definition at line 141 of file InstanceSaveMgr.h.

◆ m_difficulty

Difficulty InstanceSave::m_difficulty
private

Definition at line 140 of file InstanceSaveMgr.h.

◆ m_groupList

GroupListType InstanceSave::m_groupList
private

Definition at line 136 of file InstanceSaveMgr.h.

◆ m_instanceid

uint32 InstanceSave::m_instanceid
private

Definition at line 138 of file InstanceSaveMgr.h.

◆ m_mapid

uint32 InstanceSave::m_mapid
private

Definition at line 139 of file InstanceSaveMgr.h.

◆ m_playerList

PlayerListType InstanceSave::m_playerList
private
Todo:
: Check if maybe it's enough to just store the number of players/groups

Definition at line 135 of file InstanceSaveMgr.h.

◆ m_resetTime

time_t InstanceSave::m_resetTime
private

Definition at line 137 of file InstanceSaveMgr.h.

◆ m_toDelete

bool InstanceSave::m_toDelete
private

Definition at line 142 of file InstanceSaveMgr.h.


The documentation for this class was generated from the following files: