![]() |
TrinityCore
|
#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 |
Definition at line 73 of file CreatureGroups.h.
|
private |
Definition at line 78 of file CreatureGroups.h.
|
explicit |
Definition at line 193 of file CreatureGroups.cpp.
|
delete |
|
delete |
|
default |
| void CreatureGroup::AddMember | ( | Creature * | member | ) |
Definition at line 199 of file CreatureGroups.cpp.
References _leader, _leaderSpawnId, _members, BaseEntity::GetGUID(), Creature::GetSpawnId(), Creature::SetFormation(), sFormationMgr, and TC_LOG_DEBUG.
Referenced by SummonCreatureGroup().
| bool CreatureGroup::CanLeaderStartMoving | ( | ) | const |
Definition at line 299 of file CreatureGroups.cpp.
References _leader, _members, and Unit::IsAlive().
Referenced by Creature::IsFormationLeaderMoveAllowed().
| void CreatureGroup::FormationReset | ( | bool | dismiss | ) |
Definition at line 263 of file CreatureGroups.cpp.
References _formed, _leader, _members, FORMATION_MOTION_TYPE, Unit::IsAlive(), MOTION_SLOT_DEFAULT, and TC_LOG_DEBUG.
Referenced by Creature::Motion_Initialize(), and Creature::setDeathState().
|
inline |
Definition at line 94 of file CreatureGroups.h.
Referenced by SmartAI::JustReachedHome(), Creature::Motion_Initialize(), and Creature::setDeathState().
|
inline |
Definition at line 95 of file CreatureGroups.h.
Referenced by npc_commandscript::HandleNpcAddFormationCommand(), and FormationMgr::RemoveCreatureFromGroup().
| bool CreatureGroup::HasAliveMembers | ( | ) | const |
Definition at line 313 of file CreatureGroups.cpp.
References _members, Unit::IsAlive(), and Trinity::Containers::MapKey.
Referenced by FormationMgr::RemoveCreatureFromGroup(), and Creature::setDeathState().
|
inline |
Definition at line 100 of file CreatureGroups.h.
|
inline |
Definition at line 96 of file CreatureGroups.h.
Referenced by FormationMgr::RemoveCreatureFromGroup(), and SummonCreatureGroup().
|
inline |
Definition at line 97 of file CreatureGroups.h.
Referenced by SmartAI::JustReachedHome(), Creature::Motion_Initialize(), and npc_cameron::UpdateAI().
|
inline |
Definition at line 98 of file CreatureGroups.h.
Referenced by Creature::IsFormationLeader(), and Creature::SignalFormationMovement().
| bool CreatureGroup::LeaderHasStringId | ( | std::string_view | id | ) | const |
Definition at line 318 of file CreatureGroups.cpp.
References _leader, _leaderSpawnId, ASSERT_NOTNULL, Creature::HasStringId(), and sObjectMgr.
Referenced by instance_azure_vault::instance_azure_vault_InstanceMapScript::OnCreatureGroupDepleted(), and instance_nerubar_palace::instance_nerubar_palace_InstanceMapScript::OnCreatureGroupDepleted().
| void CreatureGroup::LeaderStartedMoving | ( | ) |
Definition at line 281 of file CreatureGroups.cpp.
References _leader, _members, FLAG_IDLE_IN_FORMATION, FORMATION_MOTION_TYPE, Unit::IsAlive(), M_PI, and MOTION_SLOT_DEFAULT.
Referenced by Creature::SignalFormationMovement().
Definition at line 224 of file CreatureGroups.cpp.
References _engaging, _leader, _members, FLAG_LEADER_ASSISTS_MEMBER, FLAG_MEMBERS_ASSIST_LEADER, FormationInfo::GroupAI, and Trinity::Containers::MapGetValuePtr().
|
delete |
|
delete |
| void CreatureGroup::RemoveMember | ( | Creature * | member | ) |
Definition at line 215 of file CreatureGroups.cpp.
References _leader, _members, and Creature::SetFormation().
Referenced by FormationMgr::RemoveCreatureFromGroup().
|
private |
Definition at line 83 of file CreatureGroups.h.
Referenced by MemberEngagingTarget().
|
private |
Definition at line 82 of file CreatureGroups.h.
Referenced by FormationReset().
|
private |
Definition at line 76 of file CreatureGroups.h.
Referenced by AddMember(), CanLeaderStartMoving(), FormationReset(), LeaderHasStringId(), LeaderStartedMoving(), MemberEngagingTarget(), and RemoveMember().
|
private |
Definition at line 81 of file CreatureGroups.h.
Referenced by AddMember(), and LeaderHasStringId().
|
private |
Definition at line 79 of file CreatureGroups.h.
Referenced by AddMember(), CanLeaderStartMoving(), FormationReset(), HasAliveMembers(), LeaderStartedMoving(), MemberEngagingTarget(), and RemoveMember().