TrinityCore
Loading...
Searching...
No Matches
GameObjectType::Transport Class Reference
+ Inheritance diagram for GameObjectType::Transport:

Public Member Functions

 Transport (GameObject &owner)
 
void Update (uint32 diff) override
 
void OnStateChanged (GOState oldState, GOState newState) override
 
void OnRelocated () override
 
void UpdatePassengerPositions ()
 
uint32 GetTransportPeriod () const
 
std::span< uint32 const > GetPauseTimes () const
 
ObjectGuid GetTransportGUID () const override
 
float GetTransportOrientation () const override
 
void AddPassenger (WorldObject *passenger, Position const &offset) override
 
TransportBase * RemovePassenger (WorldObject *passenger) override
 
Position GetPositionWithOffset (Position const &offset) const override
 This method transforms supplied transport offsets into global coordinates.
 
Position GetPositionOffsetTo (Position const &endPos) const override
 This method transforms supplied global coordinates into local offsets.
 
int32 GetMapIdForSpawning () const override
 
void SetAutoCycleBetweenStopFrames (bool on)
 
- Public Member Functions inherited from GameObjectTypeBase
 GameObjectTypeBase (GameObject &owner)
 
virtual ~GameObjectTypeBase ()=default
 
virtual bool IsNeverVisibleFor (WorldObject const *seer, bool allowServersideObjects) const
 
virtual void ActivateObject (GameObjectActions action, int32 param, WorldObject *spellCaster=nullptr, uint32 spellId=0, int32 effectIndex=-1)
 
- Public Member Functions inherited from TransportBase
void UpdatePassengerPosition (Map *map, WorldObject *passenger, Position const &position, bool setHomePosition)
 

Static Public Attributes

static constexpr Milliseconds PositionUpdateInterval = 50ms
 

Private Attributes

TransportAnimation const * _animationInfo
 
uint32 _pathProgress
 
uint32 _stateChangeTime
 
uint32 _stateChangeProgress
 
std::vector< uint32 > _stopFrames
 
bool _autoCycleBetweenStopFrames
 
TimeTracker _positionUpdateTimer
 
std::unordered_set< WorldObject * > _passengers
 

Additional Inherited Members

- Protected Member Functions inherited from TransportBase
 TransportBase ()
 
virtual ~TransportBase ()
 
- Protected Attributes inherited from GameObjectTypeBase
GameObject & _owner
 

Detailed Description

Definition at line 144 of file GameObject.cpp.

Constructor & Destructor Documentation

◆ Transport()

Member Function Documentation

◆ AddPassenger()

◆ GetMapIdForSpawning()

int32 GameObjectType::Transport::GetMapIdForSpawning ( ) const
inlineoverridevirtual

◆ GetPauseTimes()

std::span< uint32 const > GameObjectType::Transport::GetPauseTimes ( ) const
inline

Definition at line 441 of file GameObject.cpp.

References _stopFrames.

◆ GetPositionOffsetTo()

Position GameObjectType::Transport::GetPositionOffsetTo ( Position const &  endPos) const
inlineoverridevirtual

This method transforms supplied global coordinates into local offsets.

Implements TransportBase.

Definition at line 484 of file GameObject.cpp.

References GameObjectTypeBase::_owner, and Position::GetPositionOffsetTo().

◆ GetPositionWithOffset()

Position GameObjectType::Transport::GetPositionWithOffset ( Position const &  offset) const
inlineoverridevirtual

This method transforms supplied transport offsets into global coordinates.

Implements TransportBase.

Definition at line 479 of file GameObject.cpp.

References GameObjectTypeBase::_owner, and Position::GetPositionWithOffset().

◆ GetTransportGUID()

ObjectGuid GameObjectType::Transport::GetTransportGUID ( ) const
inlineoverridevirtual

Implements TransportBase.

Definition at line 446 of file GameObject.cpp.

References GameObjectTypeBase::_owner, and BaseEntity::GetGUID().

Referenced by AddPassenger().

◆ GetTransportOrientation()

float GameObjectType::Transport::GetTransportOrientation ( ) const
inlineoverridevirtual

Implements TransportBase.

Definition at line 448 of file GameObject.cpp.

References GameObjectTypeBase::_owner, and Position::GetOrientation().

◆ GetTransportPeriod()

uint32 GameObjectType::Transport::GetTransportPeriod ( ) const
inline

Definition at line 433 of file GameObject.cpp.

References _animationInfo, and TransportAnimation::TotalTime.

Referenced by OnStateChanged(), and Update().

◆ OnRelocated()

void GameObjectType::Transport::OnRelocated ( )
inlineoverridevirtual

Reimplemented from GameObjectTypeBase.

Definition at line 422 of file GameObject.cpp.

References UpdatePassengerPositions().

◆ OnStateChanged()

◆ RemovePassenger()

◆ SetAutoCycleBetweenStopFrames()

void GameObjectType::Transport::SetAutoCycleBetweenStopFrames ( bool  on)
inline

Definition at line 494 of file GameObject.cpp.

References _autoCycleBetweenStopFrames.

◆ Update()

void GameObjectType::Transport::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectTypeBase.

Definition at line 198 of file GameObject.cpp.

References _animationInfo, _autoCycleBetweenStopFrames, GameObjectTypeBase::_owner, _pathProgress, _positionUpdateTimer, _stateChangeProgress, _stateChangeTime, _stopFrames, Map::GameObjectRelocation(), GameTime::GetGameTimeMS(), GameObject::GetGOInfo(), GameObject::GetGoState(), WorldObject::GetMap(), TransportAnimation::GetNextAnimNode(), TransportAnimation::GetNextAnimRotation(), Position::GetOrientation(), TransportAnimation::GetPrevAnimNode(), TransportAnimation::GetPrevAnimRotation(), GameObject::GetStationaryPosition(), GetTransportPeriod(), GO_DYNFLAG_LO_INVERTED_MOVEMENT, GO_STATE_TRANSPORT_ACTIVE, GO_STATE_TRANSPORT_STOPPED, Object::HasDynamicFlag(), GameObject::m_gameObjectData, TimeTracker::Passed(), TransportAnimationEntry::Pos, PositionUpdateInterval, GameObjectTemplate::Reached10thfloor, GameObjectTemplate::Reached1stfloor, GameObjectTemplate::Reached2ndfloor, GameObjectTemplate::Reached3rdfloor, GameObjectTemplate::Reached4thfloor, GameObjectTemplate::Reached5thfloor, GameObjectTemplate::Reached6thfloor, GameObjectTemplate::Reached7thfloor, GameObjectTemplate::Reached8thfloor, GameObjectTemplate::Reached9thfloor, TimeTracker::Reset(), TransportRotationEntry::Rot, GameObject::SetGoState(), GameObject::SetLocalRotation(), GameObject::SetPathProgressForClient(), TransportAnimationEntry::TimeIndex, TransportRotationEntry::TimeIndex, GameObjectTemplate::transport, GameEvents::Trigger(), TimeTracker::Update(), GameObject::UpdateModelPosition(), DBCPosition3D::X, DBCPosition3D::Y, and DBCPosition3D::Z.

◆ UpdatePassengerPositions()

void GameObjectType::Transport::UpdatePassengerPositions ( )
inline

Member Data Documentation

◆ _animationInfo

TransportAnimation const* GameObjectType::Transport::_animationInfo
private

Definition at line 500 of file GameObject.cpp.

Referenced by GetTransportPeriod(), and Update().

◆ _autoCycleBetweenStopFrames

bool GameObjectType::Transport::_autoCycleBetweenStopFrames
private

Definition at line 505 of file GameObject.cpp.

Referenced by SetAutoCycleBetweenStopFrames(), and Update().

◆ _passengers

std::unordered_set<WorldObject*> GameObjectType::Transport::_passengers
private

Definition at line 507 of file GameObject.cpp.

Referenced by AddPassenger(), RemovePassenger(), and UpdatePassengerPositions().

◆ _pathProgress

uint32 GameObjectType::Transport::_pathProgress
private

Definition at line 501 of file GameObject.cpp.

Referenced by OnStateChanged(), Transport(), and Update().

◆ _positionUpdateTimer

TimeTracker GameObjectType::Transport::_positionUpdateTimer
private

Definition at line 506 of file GameObject.cpp.

Referenced by Transport(), and Update().

◆ _stateChangeProgress

uint32 GameObjectType::Transport::_stateChangeProgress
private

Definition at line 503 of file GameObject.cpp.

Referenced by OnStateChanged(), Transport(), and Update().

◆ _stateChangeTime

uint32 GameObjectType::Transport::_stateChangeTime
private

Definition at line 502 of file GameObject.cpp.

Referenced by OnStateChanged(), and Update().

◆ _stopFrames

std::vector<uint32> GameObjectType::Transport::_stopFrames
private

Definition at line 504 of file GameObject.cpp.

Referenced by GetPauseTimes(), OnStateChanged(), Transport(), and Update().

◆ PositionUpdateInterval

constexpr Milliseconds GameObjectType::Transport::PositionUpdateInterval = 50ms
staticconstexpr

Definition at line 147 of file GameObject.cpp.

Referenced by Transport(), and Update().


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