TrinityCore
Loading...
Searching...
No Matches
GenericMovementGenerator.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_GENERICMOVEMENTGENERATOR_H
19#define TRINITY_GENERICMOVEMENTGENERATOR_H
20
21#include "MovementGenerator.h"
22#include "MoveSplineInit.h"
23#include "Timer.h"
24#include <functional>
25
26class Unit;
27
29
31{
32 public:
33 explicit GenericMovementGenerator(std::function<void(Movement::MoveSplineInit& init)>&& initializer, MovementGeneratorType type, uint32 id);
34
35 bool Initialize(Unit*) override;
36 bool Reset(Unit*) override;
37 bool Update(Unit*, uint32) override;
38 void Deactivate(Unit*) override;
39 void Finalize(Unit*, bool, bool) override;
41
42 private:
43 void MovementInform(Unit*);
44
45 std::function<void(Movement::MoveSplineInit& init)> _splineInit;
49};
50
52{
53public:
54 explicit ImmediateMovementGenerator(std::function<void(Movement::MoveSplineInit& init)>&& initializer, MovementGeneratorType type, uint32 id);
55
56 bool Initialize(Unit* owner) override;
57
58 bool Reset(Unit* /*owner*/) override { return true; }
59 bool Update(Unit* /*owner*/, uint32 /*diff*/) override { return true; }
60 void Deactivate(Unit* /*owner*/) override { }
61 void Finalize(Unit* owner, bool active, bool movementInform) override;
63
64private:
65 std::function<void(Movement::MoveSplineInit& init)> _splineInit;
68};
69
70#endif
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
MovementGeneratorType
void Finalize(Unit *, bool, bool) override
bool Update(Unit *, uint32) override
MovementGeneratorType GetMovementGeneratorType() const override
std::function< void(Movement::MoveSplineInit &init)> _splineInit
bool Initialize(Unit *owner) override
bool Update(Unit *, uint32) override
void Finalize(Unit *owner, bool active, bool movementInform) override
MovementGeneratorType GetMovementGeneratorType() const override
std::function< void(Movement::MoveSplineInit &init)> _splineInit
Definition Unit.h:769