AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CreatureMovementData Struct Reference

#include "CreatureData.h"

Public Member Functions

 CreatureMovementData ()
 
bool IsGroundAllowed () const
 
bool IsSwimAllowed () const
 
bool IsFlightAllowed () const
 
bool IsRooted () const
 
CreatureChaseMovementType GetChase () const
 
CreatureRandomMovementType GetRandom () const
 
uint32 GetInteractionPauseTimer () const
 
std::string ToString () const
 

Public Attributes

CreatureGroundMovementType Ground
 
CreatureFlightMovementType Flight
 
bool Swim
 
bool Rooted
 
CreatureChaseMovementType Chase
 
CreatureRandomMovementType Random
 
uint32 InteractionPauseTimer
 

Detailed Description

Constructor & Destructor Documentation

◆ CreatureMovementData()

CreatureMovementData::CreatureMovementData ( )
Todo:
: this import is not necessary for compilation and marked as unused by the IDE
59 : Ground(CreatureGroundMovementType::Run), Flight(CreatureFlightMovementType::None),
60 Swim(true), Rooted(false), Chase(CreatureChaseMovementType::Run),
61 Random(CreatureRandomMovementType::Walk), InteractionPauseTimer(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER)) {}
@ CONFIG_CREATURE_STOP_FOR_PLAYER
Definition: IWorld.h:230
#define sWorld
Definition: World.h:451
bool Swim
Definition: CreatureData.h:130
bool Rooted
Definition: CreatureData.h:131
CreatureRandomMovementType Random
Definition: CreatureData.h:133
CreatureFlightMovementType Flight
Definition: CreatureData.h:129
CreatureChaseMovementType Chase
Definition: CreatureData.h:132
CreatureGroundMovementType Ground
Definition: CreatureData.h:128
uint32 InteractionPauseTimer
Definition: CreatureData.h:134

Member Function Documentation

◆ GetChase()

CreatureChaseMovementType CreatureMovementData::GetChase ( ) const
inline
157 {
158 return Chase;
159 }

References Chase.

Referenced by ChaseMovementGenerator< T >::DoUpdate().

◆ GetInteractionPauseTimer()

◆ GetRandom()

CreatureRandomMovementType CreatureMovementData::GetRandom ( ) const
inline
162 {
163 return Random;
164 }

References Random.

Referenced by RandomMovementGenerator< T >::_setRandomLocation().

◆ IsFlightAllowed()

bool CreatureMovementData::IsFlightAllowed ( ) const
inline
147 {
148 return Flight != CreatureFlightMovementType::None;
149 }

References Flight.

Referenced by Creature::CanFly(), and Creature::UpdateMovementFlags().

◆ IsGroundAllowed()

bool CreatureMovementData::IsGroundAllowed ( ) const
inline
137 {
138 return Ground != CreatureGroundMovementType::None;
139 }

References Ground.

Referenced by Creature::CanWalk().

◆ IsRooted()

bool CreatureMovementData::IsRooted ( ) const
inline
152 {
153 return Rooted;
154 }

References Rooted.

◆ IsSwimAllowed()

bool CreatureMovementData::IsSwimAllowed ( ) const
inline
142 {
143 return Swim;
144 }

References Swim.

Referenced by Creature::CanEnterWater().

◆ ToString()

std::string CreatureMovementData::ToString ( ) const
64{
65 constexpr std::array<char const*, 3> GroundStates = {"None", "Run", "Hover"};
66 constexpr std::array<char const*, 3> FlightStates = {"None", "DisableGravity", "CanFly"};
67 constexpr std::array<char const*, 3> ChaseStates = {"Run", "CanWalk", "AlwaysWalk"};
68 constexpr std::array<char const*, 3> RandomStates = {"Walk", "CanRun", "AlwaysRun"};
69
70 std::ostringstream str;
71 str << std::boolalpha
72 << "Ground: " << GroundStates[AsUnderlyingType(Ground)]
73 << ", Swim: " << Swim
74 << ", Flight: " << FlightStates[AsUnderlyingType(Flight)]
75 << ", Chase: " << ChaseStates[AsUnderlyingType(Chase)]
76 << ", Random: " << RandomStates[AsUnderlyingType(Random)];
77 if (Rooted)
78 str << ", Rooted";
79 str << ", InteractionPauseTimer: " << InteractionPauseTimer;
80
81 return str.str();
82}
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
Definition: Util.h:614

References AsUnderlyingType(), Chase, Flight, Ground, InteractionPauseTimer, Random, Rooted, and Swim.

Member Data Documentation

◆ Chase

◆ Flight

◆ Ground

◆ InteractionPauseTimer

uint32 CreatureMovementData::InteractionPauseTimer

◆ Random

◆ Rooted

bool CreatureMovementData::Rooted

◆ Swim

bool CreatureMovementData::Swim