Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
PointMovementGenerator.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SKYFIRE_POINTMOVEMENTGENERATOR_H
7#define SKYFIRE_POINTMOVEMENTGENERATOR_H
8
9#include "FollowerReference.h"
10#include "MovementGenerator.h"
11
12template<class T>
13class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
14{
15public:
16 PointMovementGenerator(uint32 _id, float _x, float _y, float _z, bool _generatePath, float _speed = 0.0f) : id(_id),
17 i_x(_x), i_y(_y), i_z(_z), speed(_speed), m_generatePath(_generatePath), i_recalculateSpeed(false) { }
18
19 void DoInitialize(T*);
20 void DoFinalize(T*);
21 void DoReset(T*);
22 bool DoUpdate(T*, uint32);
23
24 void MovementInform(T*);
25
27
29
30 void GetDestination(float& x, float& y, float& z) const { x = i_x; y = i_y; z = i_z; }
31private:
33 float i_x, i_y, i_z;
34 float speed;
37};
38
40{
41public:
42 AssistanceMovementGenerator(float _x, float _y, float _z) :
43 PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
44
46 void Finalize(Unit*);
47};
48
49// Does almost nothing - just doesn't allows previous movegen interrupt current effect.
51{
52public:
53 explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) { }
54 void Initialize(Unit*) { }
55 void Finalize(Unit*);
56 void Reset(Unit*) { }
57 bool Update(Unit*, uint32);
59private:
61};
62
63#endif
std::uint32_t uint32
Definition Define.h:77
MovementGeneratorType
@ ASSISTANCE_MOTION_TYPE
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
MovementGeneratorType GetMovementGeneratorType()
AssistanceMovementGenerator(float _x, float _y, float _z)
MovementGeneratorType GetMovementGeneratorType()
void GetDestination(float &x, float &y, float &z) const
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, bool _generatePath, float _speed=0.0f)
MovementGeneratorType GetMovementGeneratorType()
Definition Unit.h:1367