TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IdleMovementGenerator.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_IDLEMOVEMENTGENERATOR_H
20 #define TRINITY_IDLEMOVEMENTGENERATOR_H
21 
22 #include "MovementGenerator.h"
23 
25 {
26  public:
27 
28  void Initialize(Unit*) override;
29  void Finalize(Unit*) override { }
30  void Reset(Unit*) override;
31  bool Update(Unit*, uint32) override { return true; }
33 };
34 
36 
38 {
39  public:
40  explicit RotateMovementGenerator(uint32 time, RotateDirection direction) : m_duration(time), m_maxDuration(time), m_direction(direction) { }
41 
42  void Initialize(Unit*) override;
43  void Finalize(Unit*) override;
44  void Reset(Unit* owner) override { Initialize(owner); }
45  bool Update(Unit*, uint32) override;
47 
48  private:
51 };
52 
54 {
55  public:
56  explicit DistractMovementGenerator(uint32 timer) : m_timer(timer) { }
57 
58  void Initialize(Unit*) override;
59  void Finalize(Unit*) override;
60  void Reset(Unit* owner) override { Initialize(owner); }
61  bool Update(Unit*, uint32) override;
63 
64  private:
66 };
67 
69 {
70  public:
72  DistractMovementGenerator(timer) { }
73 
75  void Finalize(Unit*) override;
76 };
77 
78 #endif
Definition: MotionMaster.h:37
Definition: MotionMaster.h:53
RotateDirection m_direction
Definition: IdleMovementGenerator.h:50
Definition: IdleMovementGenerator.h:53
void Reset(Unit *owner) override
Definition: IdleMovementGenerator.h:60
Definition: IdleMovementGenerator.h:37
bool Update(Unit *, uint32) override
Definition: IdleMovementGenerator.h:31
void Finalize(Unit *) override
Definition: IdleMovementGenerator.cpp:105
AssistanceDistractMovementGenerator(uint32 timer)
Definition: IdleMovementGenerator.h:71
DistractMovementGenerator(uint32 timer)
Definition: IdleMovementGenerator.h:56
Definition: MotionMaster.h:48
void Finalize(Unit *) override
Definition: IdleMovementGenerator.cpp:84
uint32 m_maxDuration
Definition: IdleMovementGenerator.h:49
TC_GAME_API IdleMovementGenerator si_idleMovement
Definition: IdleMovementGenerator.cpp:24
void Finalize(Unit *) override
Definition: IdleMovementGenerator.cpp:68
void Initialize(Unit *) override
Definition: IdleMovementGenerator.cpp:39
uint32 m_duration
Definition: IdleMovementGenerator.h:49
uint32_t uint32
Definition: Define.h:150
uint32 m_timer
Definition: IdleMovementGenerator.h:65
void Finalize(Unit *) override
Definition: IdleMovementGenerator.h:29
MovementGeneratorType GetMovementGeneratorType() const override
Definition: IdleMovementGenerator.h:32
Definition: MotionMaster.h:50
void Initialize(Unit *) override
Definition: IdleMovementGenerator.cpp:75
RotateDirection
Definition: MotionMaster.h:73
#define TC_GAME_API
Definition: Define.h:134
MovementGeneratorType GetMovementGeneratorType() const override
Definition: IdleMovementGenerator.h:74
MovementGeneratorType
Definition: MotionMaster.h:35
MovementGeneratorType GetMovementGeneratorType() const override
Definition: IdleMovementGenerator.h:62
void Initialize(Unit *) override
Definition: IdleMovementGenerator.cpp:28
Definition: IdleMovementGenerator.h:24
void Reset(Unit *owner) override
Definition: IdleMovementGenerator.h:44
bool Update(Unit *, uint32) override
Definition: IdleMovementGenerator.cpp:51
RotateMovementGenerator(uint32 time, RotateDirection direction)
Definition: IdleMovementGenerator.h:40
Definition: MovementGenerator.h:30
MovementGeneratorType GetMovementGeneratorType() const override
Definition: IdleMovementGenerator.h:46
Definition: Unit.h:1305
void Reset(Unit *) override
Definition: IdleMovementGenerator.cpp:33
Definition: IdleMovementGenerator.h:68
bool Update(Unit *, uint32) override
Definition: IdleMovementGenerator.cpp:96