Magic_Game/core/Action/ActionDelay.cpp

27 lines
419 B
C++
Raw Normal View History

2017-10-19 00:50:04 +08:00
#include "..\eactions.h"
e2d::ActionDelay::ActionDelay(float duration)
2017-10-19 00:50:04 +08:00
{
2018-01-30 16:45:38 +08:00
m_fDelayTime = max(duration, 0);
2017-10-19 00:50:04 +08:00
}
e2d::ActionDelay * e2d::ActionDelay::clone() const
2017-10-19 00:50:04 +08:00
{
return new ActionDelay(m_fDelayTime);
2017-10-19 00:50:04 +08:00
}
void e2d::ActionDelay::_init()
2017-10-19 00:50:04 +08:00
{
Action::_init();
2017-10-19 00:50:04 +08:00
}
void e2d::ActionDelay::_update()
2017-10-19 00:50:04 +08:00
{
Action::_update();
2017-10-19 00:50:04 +08:00
// <20>ж<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>
if ((Time::getTotalTime() - m_fLast) >= m_fDelayTime)
2017-10-19 00:50:04 +08:00
{
this->stop();
}
}