*Backed out changeset 3be01fb200a5

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 15:51:44 -07:00
parent 26b5e033ff
commit e585187b24
2257 changed files with 103863 additions and 761 deletions
+11
View File
@@ -17,12 +17,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRINITY_TARGETEDMOVEMENTGENERATOR_H
#define TRINITY_TARGETEDMOVEMENTGENERATOR_H
#include "MovementGenerator.h"
#include "DestinationHolder.h"
#include "Traveller.h"
#include "FollowerReference.h"
class TRINITY_DLL_SPEC TargetedMovementGeneratorBase
{
public:
@@ -31,6 +34,7 @@ class TRINITY_DLL_SPEC TargetedMovementGeneratorBase
protected:
FollowerReference i_target;
};
template<class T>
class TRINITY_DLL_SPEC TargetedMovementGenerator
: public MovementGeneratorMedium< T, TargetedMovementGenerator<T> >, public TargetedMovementGeneratorBase
@@ -38,22 +42,29 @@ class TRINITY_DLL_SPEC TargetedMovementGenerator
public:
TargetedMovementGenerator(Unit &target, float offset = 0, float angle = 0);
~TargetedMovementGenerator() {}
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
bool Update(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return TARGETED_MOTION_TYPE; }
void MovementInform(T &);
Unit* GetTarget() const;
bool GetDestination(float &x, float &y, float &z) const
{
if(i_destinationHolder.HasArrived() || !i_destinationHolder.HasDestination()) return false;
i_destinationHolder.GetDestination(x,y,z);
return true;
}
void unitSpeedChanged() { i_recalculateTravel=true; }
private:
bool _setTargetLocation(T &);
float i_offset;
float i_angle;
DestinationHolder< Traveller<T> > i_destinationHolder;