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
58 : Ground(CreatureGroundMovementType::Run), Flight(CreatureFlightMovementType::None),
59 Swim(true), Rooted(false), Chase(CreatureChaseMovementType::Run),
60 Random(CreatureRandomMovementType::Walk), InteractionPauseTimer(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER)) {}
@ CONFIG_CREATURE_STOP_FOR_PLAYER
Definition: IWorld.h:236
#define sWorld
Definition: World.h:444
bool Swim
Definition: CreatureData.h:127
bool Rooted
Definition: CreatureData.h:128
CreatureRandomMovementType Random
Definition: CreatureData.h:130
CreatureFlightMovementType Flight
Definition: CreatureData.h:126
CreatureChaseMovementType Chase
Definition: CreatureData.h:129
CreatureGroundMovementType Ground
Definition: CreatureData.h:125
uint32 InteractionPauseTimer
Definition: CreatureData.h:131

Member Function Documentation

◆ GetChase()

CreatureChaseMovementType CreatureMovementData::GetChase ( ) const
inline
154 {
155 return Chase;
156 }

References Chase.

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

◆ GetInteractionPauseTimer()

◆ GetRandom()

CreatureRandomMovementType CreatureMovementData::GetRandom ( ) const
inline
159 {
160 return Random;
161 }

References Random.

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

◆ IsFlightAllowed()

bool CreatureMovementData::IsFlightAllowed ( ) const
inline
144 {
145 return Flight != CreatureFlightMovementType::None;
146 }

References Flight.

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

◆ IsGroundAllowed()

bool CreatureMovementData::IsGroundAllowed ( ) const
inline
134 {
135 return Ground != CreatureGroundMovementType::None;
136 }

References Ground.

Referenced by Creature::CanWalk().

◆ IsRooted()

bool CreatureMovementData::IsRooted ( ) const
inline
149 {
150 return Rooted;
151 }

References Rooted.

Referenced by Creature::IsRooted().

◆ IsSwimAllowed()

bool CreatureMovementData::IsSwimAllowed ( ) const
inline
139 {
140 return Swim;
141 }

References Swim.

Referenced by Creature::CanEnterWater().

◆ ToString()

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

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