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

Member Function Documentation

◆ GetChase()

CreatureChaseMovementType CreatureMovementData::GetChase ( ) const
inline
151 {
152 return Chase;
153 }

References Chase.

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

◆ GetInteractionPauseTimer()

◆ GetRandom()

CreatureRandomMovementType CreatureMovementData::GetRandom ( ) const
inline
156 {
157 return Random;
158 }

References Random.

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

◆ IsFlightAllowed()

bool CreatureMovementData::IsFlightAllowed ( ) const
inline
141 {
142 return Flight != CreatureFlightMovementType::None;
143 }

References Flight.

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

◆ IsGroundAllowed()

bool CreatureMovementData::IsGroundAllowed ( ) const
inline
131 {
132 return Ground != CreatureGroundMovementType::None;
133 }

References Ground.

Referenced by Creature::CanWalk().

◆ IsRooted()

bool CreatureMovementData::IsRooted ( ) const
inline
146 {
147 return Rooted;
148 }

References Rooted.

Referenced by Creature::IsRooted().

◆ IsSwimAllowed()

bool CreatureMovementData::IsSwimAllowed ( ) const
inline
136 {
137 return Swim;
138 }

References Swim.

Referenced by Creature::CanEnterWater().

◆ ToString()

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