initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include "Cevo/Delay.h"
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
void Delay::start()
|
||||
{
|
||||
m_startTime = QDateTime::currentDateTime();
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
void Delay::stop()
|
||||
{
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
void Delay::setEnabled(bool value)
|
||||
{
|
||||
Q_UNUSED(value);
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
bool Delay::isOverflowed() const
|
||||
{
|
||||
return m_enabled && m_startTime.msecsTo(QDateTime::currentDateTime()) > durationMs;
|
||||
}
|
||||
|
||||
bool Delay::isRunning() const
|
||||
{
|
||||
return m_enabled && m_startTime.msecsTo(QDateTime::currentDateTime()) <= durationMs;
|
||||
}
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user