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

#include <CreatureGroups.h>

Public Member Functions

 CreatureGroup (ObjectGuid::LowType leaderSpawnId)
 
 ~CreatureGroup ()
 
Creature * GetLeader () const
 
ObjectGuid::LowType GetLeaderSpawnId () const
 
bool IsEmpty () const
 
bool IsFormed () const
 
bool IsLeader (Creature const *creature) const
 
bool HasMember (Creature *member) const
 
void AddMember (Creature *member)
 
void RemoveMember (Creature *member)
 
void FormationReset (bool dismiss)
 
void LeaderStartedMoving ()
 
void MemberEngagingTarget (Creature *member, Unit *target)
 
bool CanLeaderStartMoving () const
 

Private Attributes

Creature * _leader
 
std::unordered_map< Creature *, FormationInfo * > _members
 
ObjectGuid::LowType _leaderSpawnId
 
bool _formed
 
bool _engaging
 

Detailed Description

Definition at line 69 of file CreatureGroups.h.

Constructor & Destructor Documentation

◆ CreatureGroup()

CreatureGroup::CreatureGroup ( ObjectGuid::LowType  leaderSpawnId)
explicit

Definition at line 192 of file CreatureGroups.cpp.

◆ ~CreatureGroup()

CreatureGroup::~CreatureGroup ( )

Definition at line 196 of file CreatureGroups.cpp.

Member Function Documentation

◆ AddMember()

◆ CanLeaderStartMoving()

bool CreatureGroup::CanLeaderStartMoving ( ) const

Definition at line 298 of file CreatureGroups.cpp.

References _leader, _members, and Unit::IsAlive().

Referenced by Creature::IsFormationLeaderMoveAllowed().

◆ FormationReset()

void CreatureGroup::FormationReset ( bool  dismiss)

◆ GetLeader()

Creature * CreatureGroup::GetLeader ( ) const
inline

◆ GetLeaderSpawnId()

ObjectGuid::LowType CreatureGroup::GetLeaderSpawnId ( ) const
inline

◆ HasMember()

bool CreatureGroup::HasMember ( Creature *  member) const
inline

Definition at line 90 of file CreatureGroups.h.

◆ IsEmpty()

bool CreatureGroup::IsEmpty ( ) const
inline

Definition at line 86 of file CreatureGroups.h.

Referenced by FormationMgr::RemoveCreatureFromGroup().

◆ IsFormed()

bool CreatureGroup::IsFormed ( ) const
inline

◆ IsLeader()

bool CreatureGroup::IsLeader ( Creature const *  creature) const
inline

◆ LeaderStartedMoving()

◆ MemberEngagingTarget()

◆ RemoveMember()

void CreatureGroup::RemoveMember ( Creature *  member)

Definition at line 217 of file CreatureGroups.cpp.

References _leader, _members, and Creature::SetFormation().

Referenced by FormationMgr::RemoveCreatureFromGroup().

Member Data Documentation

◆ _engaging

bool CreatureGroup::_engaging
private

Definition at line 77 of file CreatureGroups.h.

Referenced by MemberEngagingTarget().

◆ _formed

bool CreatureGroup::_formed
private

Definition at line 76 of file CreatureGroups.h.

Referenced by FormationReset().

◆ _leader

Creature* CreatureGroup::_leader
private

◆ _leaderSpawnId

ObjectGuid::LowType CreatureGroup::_leaderSpawnId
private

Definition at line 75 of file CreatureGroups.h.

Referenced by AddMember().

◆ _members

std::unordered_map<Creature*, FormationInfo*> CreatureGroup::_members
private

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