TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RandomMovementGenerator.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_RANDOMMOTIONGENERATOR_H
20 #define TRINITY_RANDOMMOTIONGENERATOR_H
21 
22 #include "MovementGenerator.h"
23 
24 template<class T>
25 class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator<T> >
26 {
27  public:
28  RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) { }
29 
30  void _setRandomLocation(T*);
31  void DoInitialize(T*);
32  void DoFinalize(T*);
33  void DoReset(T*);
34  bool DoUpdate(T*, const uint32);
35  bool GetResetPos(T*, float& x, float& y, float& z);
37  private:
39 
41 };
42 #endif
TimeTrackerSmall i_nextMoveTime
Definition: RandomMovementGenerator.h:38
Definition: MotionMaster.h:38
Definition: Timer.h:134
Definition: RandomMovementGenerator.h:25
float wander_distance
Definition: RandomMovementGenerator.h:40
MovementGeneratorType GetMovementGeneratorType() const override
Definition: RandomMovementGenerator.h:36
G3D::int16 z
Definition: Vector3int16.h:46
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
Definition: MovementGenerator.h:51
RandomMovementGenerator(float spawn_dist=0.0f)
Definition: RandomMovementGenerator.h:28
bool DoUpdate(T *, const uint32)
MovementGeneratorType
Definition: MotionMaster.h:35
G3D::int16 x
Definition: Vector2int16.h:37
bool GetResetPos(T *, float &x, float &y, float &z)