2016-01-12 03:41:44 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 15.03.16.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <apps/openmw-mp/Script/ScriptFunctions.hpp>
|
|
|
|
#include <components/openmw-mp/NetworkMessages.hpp>
|
|
|
|
#include <Player.hpp>
|
|
|
|
#include <Networking.hpp>
|
|
|
|
#include <Script/API/TimerAPI.hpp>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace mwmp;
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
int ScriptFunctions::createTimer(ScriptFunc callback, int msec) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-07-27 02:09:56 +00:00
|
|
|
return -1;
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
int ScriptFunctions::createTimerEx(ScriptFunc callback, int msec, const char *types, ...) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-07-27 02:09:56 +00:00
|
|
|
return -1;
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::startTimer(int timerId) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 15:39:44 +00:00
|
|
|
TimerAPI::startTimer(timerId);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::stopTimer(int timerId) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 15:39:44 +00:00
|
|
|
TimerAPI::stopTimer(timerId);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::restartTimer(int timerId, int msec) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 15:39:44 +00:00
|
|
|
TimerAPI::resetTimer(timerId, msec);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
void ScriptFunctions::freeTimer(int timerId) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 15:39:44 +00:00
|
|
|
TimerAPI::freeTimer(timerId);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
2016-11-16 15:39:44 +00:00
|
|
|
bool ScriptFunctions::isTimerElapsed(int timerId) noexcept
|
2016-01-12 03:41:44 +00:00
|
|
|
{
|
2016-11-16 15:39:44 +00:00
|
|
|
return TimerAPI::isEndTimer(timerId);
|
2016-01-12 03:41:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|