Magic_Game/core/Action/MoveTo.cpp

20 lines
322 B
C++
Raw Normal View History

#include "..\e2daction.h"
2018-05-24 00:58:16 +08:00
#include "..\e2dnode.h"
2018-05-10 14:03:54 +08:00
e2d::MoveTo::MoveTo(double duration, Point pos)
: MoveBy(duration, Vector())
{
_endPos = pos;
}
e2d::MoveTo * e2d::MoveTo::clone() const
{
return Create<MoveTo>(_duration, _endPos);
}
void e2d::MoveTo::_init()
{
MoveBy::_init();
_deltaPos = _endPos - _startPos;
}