TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FleeingMovementGenerator.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITY_FLEEINGMOVEMENTGENERATOR_H
20 #define TRINITY_FLEEINGMOVEMENTGENERATOR_H
21 
22 #include "MovementGenerator.h"
23 
24 template<class T>
25 class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator<T> >
26 {
27  public:
29 
30  void DoInitialize(T*);
31  void DoFinalize(T*);
32  void DoReset(T*);
33  bool DoUpdate(T*, uint32);
34 
36 
37  private:
38  void _setTargetLocation(T*);
39  void _getPoint(T*, float &x, float &y, float &z);
40 
43 };
44 
46 {
47  public:
50  i_totalFleeTime(time) { }
51 
53  bool Update(Unit*, uint32) override;
54  void Finalize(Unit*) override;
55 
56  private:
58 };
59 
60 #endif
Definition: FleeingMovementGenerator.h:45
ObjectGuid i_frightGUID
Definition: FleeingMovementGenerator.h:41
Definition: FleeingMovementGenerator.h:25
TimeTracker i_totalFleeTime
Definition: FleeingMovementGenerator.h:57
TimedFleeingMovementGenerator(ObjectGuid fright, uint32 time)
Definition: FleeingMovementGenerator.h:48
Definition: Creature.h:467
void _setTargetLocation(T *)
Definition: FleeingMovementGenerator.cpp:33
Definition: MotionMaster.h:47
void _getPoint(T *, float &x, float &y, float &z)
Definition: FleeingMovementGenerator.cpp:76
void DoInitialize(T *)
Definition: FleeingMovementGenerator.cpp:117
Definition: MotionMaster.h:51
bool DoUpdate(T *, uint32)
Definition: FleeingMovementGenerator.cpp:151
G3D::int16 z
Definition: Vector3int16.h:46
uint32_t uint32
Definition: Define.h:150
void DoReset(T *)
Definition: FleeingMovementGenerator.cpp:145
G3D::int16 y
Definition: Vector2int16.h:38
FleeingMovementGenerator(ObjectGuid fright)
Definition: FleeingMovementGenerator.h:28
Definition: MovementGenerator.h:51
TimeTracker i_nextCheckTime
Definition: FleeingMovementGenerator.h:42
Definition: Timer.h:100
MovementGeneratorType
Definition: MotionMaster.h:35
MovementGeneratorType GetMovementGeneratorType() const override
Definition: FleeingMovementGenerator.h:35
Definition: ObjectGuid.h:189
G3D::int16 x
Definition: Vector2int16.h:37
MovementGeneratorType GetMovementGeneratorType() const override
Definition: FleeingMovementGenerator.h:52
Definition: Unit.h:1305
void Finalize(Unit *) override
Definition: FleeingMovementGenerator.cpp:180
bool Update(Unit *, uint32) override
Definition: FleeingMovementGenerator.cpp:194