Magic_Game/core/actions/MoveTo.cpp

20 lines
340 B
C++
Raw Normal View History

#include "..\e2daction.h"
2018-09-06 23:26:32 +08:00
#include "..\e2dobject.h"
2018-07-28 20:06:27 +08:00
e2d::MoveTo::MoveTo(float duration, Point pos)
2018-09-04 22:42:34 +08:00
: MoveBy(duration, Point())
{
2018-09-04 22:42:34 +08:00
end_pos_ = pos;
}
2018-09-04 22:42:34 +08:00
e2d::MoveTo * e2d::MoveTo::Clone() const
{
2018-09-04 22:42:34 +08:00
return new (e2d::autorelease) MoveTo(duration_, end_pos_);
}
2018-09-04 22:42:34 +08:00
void e2d::MoveTo::Init()
{
2018-09-04 22:42:34 +08:00
MoveBy::Init();
delta_pos_ = end_pos_ - start_pos_;
}