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

#include <CreatureGroups.h>

Public Member Functions

 CreatureGroup (ObjectGuid::LowType leaderSpawnId)
 
 CreatureGroup (CreatureGroup const &)=delete
 
 CreatureGroup (CreatureGroup &&)=delete
 
CreatureGroup & operator= (CreatureGroup const &)=delete
 
CreatureGroup & operator= (CreatureGroup &&)=delete
 
 ~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
 
bool HasAliveMembers () const
 
bool LeaderHasStringId (std::string_view id) const
 

Private Types

using MembersMap = std::unordered_map< Creature *, FormationInfo * >
 

Private Attributes

Creature * _leader
 
MembersMap _members
 
ObjectGuid::LowType _leaderSpawnId
 
bool _formed
 
bool _engaging
 

Detailed Description

Definition at line 73 of file CreatureGroups.h.

Member Typedef Documentation

◆ MembersMap

using CreatureGroup::MembersMap = std::unordered_map<Creature*, FormationInfo*>
private

Definition at line 78 of file CreatureGroups.h.

Constructor & Destructor Documentation

◆ CreatureGroup() [1/3]

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

Definition at line 193 of file CreatureGroups.cpp.

◆ CreatureGroup() [2/3]

CreatureGroup::CreatureGroup ( CreatureGroup const &  )
delete

◆ CreatureGroup() [3/3]

CreatureGroup::CreatureGroup ( CreatureGroup &&  )
delete

◆ ~CreatureGroup()

CreatureGroup::~CreatureGroup ( )
default

Member Function Documentation

◆ AddMember()

void CreatureGroup::AddMember ( Creature *  member)

◆ CanLeaderStartMoving()

bool CreatureGroup::CanLeaderStartMoving ( ) const

Definition at line 299 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

◆ HasAliveMembers()

bool CreatureGroup::HasAliveMembers ( ) const

◆ HasMember()

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

Definition at line 100 of file CreatureGroups.h.

◆ IsEmpty()

bool CreatureGroup::IsEmpty ( ) const
inline

Definition at line 96 of file CreatureGroups.h.

Referenced by FormationMgr::RemoveCreatureFromGroup(), and SummonCreatureGroup().

◆ IsFormed()

bool CreatureGroup::IsFormed ( ) const
inline

◆ IsLeader()

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

◆ LeaderHasStringId()

◆ LeaderStartedMoving()

void CreatureGroup::LeaderStartedMoving ( )

◆ MemberEngagingTarget()

void CreatureGroup::MemberEngagingTarget ( Creature *  member,
Unit *  target 
)

◆ operator=() [1/2]

CreatureGroup & CreatureGroup::operator= ( CreatureGroup &&  )
delete

◆ operator=() [2/2]

CreatureGroup & CreatureGroup::operator= ( CreatureGroup const &  )
delete

◆ RemoveMember()

void CreatureGroup::RemoveMember ( Creature *  member)

Definition at line 215 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 83 of file CreatureGroups.h.

Referenced by MemberEngagingTarget().

◆ _formed

bool CreatureGroup::_formed
private

Definition at line 82 of file CreatureGroups.h.

Referenced by FormationReset().

◆ _leader

◆ _leaderSpawnId

ObjectGuid::LowType CreatureGroup::_leaderSpawnId
private

Definition at line 81 of file CreatureGroups.h.

Referenced by AddMember(), and LeaderHasStringId().

◆ _members


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