2016-02-21 08:25:46 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-01-29 17:44:55 +01:00
|
|
|
#include "Misc/Routine.hpp"
|
2016-03-25 13:43:26 +01:00
|
|
|
#include "Library/Chrono.hpp"
|
2016-02-21 08:25:46 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-17 22:10:31 +01:00
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-02-21 08:25:46 +01:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-11-15 20:43:02 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2020-04-02 23:26:17 +02:00
|
|
|
SQMODE_DECL_TYPENAME(Typename, _SC("SqRoutineInstance"))
|
2016-11-15 20:43:02 +01:00
|
|
|
|
2016-02-21 08:25:46 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
Routine::Time Routine::s_Last = 0;
|
|
|
|
Routine::Time Routine::s_Prev = 0;
|
2016-11-17 22:10:31 +01:00
|
|
|
Routine::Interval Routine::s_Intervals[SQMOD_MAX_ROUTINES];
|
|
|
|
Routine::Instance Routine::s_Instances[SQMOD_MAX_ROUTINES];
|
2020-04-10 07:30:22 +02:00
|
|
|
bool Routine::s_Silenced = false;
|
2016-03-12 07:47:50 +01:00
|
|
|
|
2016-02-23 04:23:56 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void Routine::Process()
|
2016-02-23 04:23:56 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
// Is this the first call?
|
|
|
|
if (s_Last == 0)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-06-04 18:17:42 +02:00
|
|
|
s_Last = Chrono::GetCurrentSysTime();
|
2016-05-22 05:20:38 +02:00
|
|
|
// We'll do it text time
|
2016-03-10 04:57:13 +01:00
|
|
|
return;
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
// Backup the last known time-stamp
|
|
|
|
s_Prev = s_Last;
|
|
|
|
// Get the current time-stamp
|
2016-06-04 18:17:42 +02:00
|
|
|
s_Last = Chrono::GetCurrentSysTime();
|
2016-05-22 05:20:38 +02:00
|
|
|
// Calculate the elapsed time
|
2020-03-22 05:53:04 +01:00
|
|
|
const auto delta = Int32((s_Last - s_Prev) / 1000L);
|
2016-05-22 05:20:38 +02:00
|
|
|
// Process all active routines
|
2017-02-21 20:42:40 +01:00
|
|
|
for (Interval * itr = s_Intervals; itr != (s_Intervals + SQMOD_MAX_ROUTINES); ++itr)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-05-22 05:20:38 +02:00
|
|
|
// Is this routine valid?
|
2016-11-17 22:10:31 +01:00
|
|
|
if (*itr)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Decrease the elapsed time
|
|
|
|
(*itr) -= delta;
|
|
|
|
// Have we completed the routine interval?
|
|
|
|
if ((*itr) <= 0)
|
|
|
|
{
|
|
|
|
// Execute and reset the elapsed time
|
|
|
|
(*itr) = s_Instances[itr - s_Intervals].Execute();
|
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-05-22 05:20:38 +02:00
|
|
|
void Routine::Initialize()
|
2016-03-10 04:57:13 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
std::memset(s_Intervals, 0, sizeof(s_Intervals));
|
2020-04-10 07:30:22 +02:00
|
|
|
SetSilenced(!ErrorHandling::IsEnabled());
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
void Routine::Deinitialize()
|
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Release any script resources that the routines might store
|
|
|
|
for (auto & r : s_Instances)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
r.Terminate();
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2016-11-17 22:10:31 +01:00
|
|
|
SQInteger Routine::Create(HSQUIRRELVM vm)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Locate the identifier of a free slot
|
|
|
|
const SQInteger slot = FindUnused();
|
|
|
|
// See if we have where to store this routine
|
|
|
|
if (slot < 0)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Reached the maximum number of active routines");
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Grab the top of the stack
|
|
|
|
const SQInteger top = sq_gettop(vm);
|
|
|
|
// See if too many arguments were specified
|
|
|
|
if (top >= 20) /* 5 base + 14 parameters = 19 */
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Too many parameters specified");
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Was there was an environment specified?
|
|
|
|
else if (top <= 1)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Missing routine environment");
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Was there was a callback specified?
|
|
|
|
else if (top <= 2)
|
2016-03-10 04:57:13 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Missing routine callback");
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Validate the callback type
|
|
|
|
else if (sq_gettype(vm, 3) != OT_CLOSURE && sq_gettype(vm, 3) != OT_NATIVECLOSURE)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Invalid callback type");
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-03-10 04:57:13 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
SQRESULT res = SQ_OK;
|
|
|
|
// Prepare an object for the environment
|
|
|
|
HSQOBJECT env;
|
2019-07-26 18:59:34 +02:00
|
|
|
// Get the type of the environment object
|
|
|
|
const SQObjectType etype = sq_gettype(vm, 2);
|
|
|
|
// Whether to default to the root table
|
|
|
|
bool use_root = etype == OT_NULL;
|
|
|
|
// Is the specified environment a boolean (true) value?
|
|
|
|
if (etype == OT_STRING)
|
|
|
|
{
|
|
|
|
// Attempt to generate the string value
|
|
|
|
StackStrF val(vm, 2);
|
|
|
|
// Have we failed to retrieve the string?
|
|
|
|
if (SQ_FAILED(val.Proc()))
|
|
|
|
{
|
|
|
|
return val.mRes; // Propagate the error!
|
|
|
|
}
|
|
|
|
// If the string is empty or "root" then we use the root table
|
|
|
|
else if (!val.mLen || sqmod_stricmp(val.mPtr, "root") == 0)
|
|
|
|
{
|
|
|
|
use_root = true;
|
|
|
|
}
|
|
|
|
// If the string is "self" then we leave it null and default to self
|
|
|
|
else if (sqmod_stricmp(val.mPtr, "self") == 0)
|
|
|
|
{
|
|
|
|
sq_resetobject(&env); // Make sure environment is null
|
|
|
|
use_root = false; // Just in case
|
|
|
|
}
|
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Is the specified environment a null value?
|
2019-07-26 18:59:34 +02:00
|
|
|
if (use_root)
|
2016-02-23 04:23:56 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Push the root table on the stack
|
|
|
|
sq_pushroottable(vm);
|
|
|
|
// Attempt to retrieve the table object
|
|
|
|
res = sq_getstackobj(vm, -1, &env);
|
2020-05-01 00:24:06 +02:00
|
|
|
// Preserve the stack state
|
|
|
|
sq_poptop(vm);
|
2016-07-12 21:45:14 +02:00
|
|
|
}
|
2019-07-26 18:59:34 +02:00
|
|
|
// Should we treat it as a valid environment object?
|
|
|
|
else if (etype != OT_STRING)
|
2016-07-12 21:45:14 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
sq_getstackobj(vm, 2, &env); // Just retrieve the specified environment
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return res; // Propagate the error
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// Prepare an object for the function
|
|
|
|
HSQOBJECT func;
|
|
|
|
// Fetch the specified callback object
|
|
|
|
res = sq_getstackobj(vm, 3, &func);
|
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return res; // Propagate the error
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// The number of iterations and interval to execute the routine
|
|
|
|
SQInteger intrv = 0, itr = 0;
|
|
|
|
// Was there an interval specified?
|
|
|
|
if (top > 3)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Grab the interval from the stack
|
|
|
|
res = sq_getinteger(vm, 4, &intrv);
|
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
2016-05-24 06:24:21 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return res; // Propagate the error
|
2016-05-24 06:24:21 +02:00
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Was there a number of iterations specified?
|
|
|
|
if (top > 4)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Grab the iterations from the stack
|
|
|
|
res = sq_getinteger(vm, 5, &itr);
|
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
2016-05-24 06:24:21 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return res; // Propagate the error
|
2016-05-24 06:24:21 +02:00
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// Attempt to create a routine instance
|
|
|
|
try
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2020-05-01 00:24:06 +02:00
|
|
|
DeleteGuard< Routine > dg(new Routine());
|
|
|
|
ClassType< Routine >::PushInstance(vm, dg.Get());
|
|
|
|
dg.Release();
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
catch (const Sqrat::Exception & e)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return sq_throwerror(vm, "Unable to create the routine instance");
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
// Prepare an object for the routine
|
|
|
|
HSQOBJECT obj;
|
|
|
|
// Fetch the created routine object
|
|
|
|
res = sq_getstackobj(vm, -1, &obj);
|
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
return res; // Propagate the error
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// At this point we can grab a reference to our slot
|
|
|
|
Instance & inst = s_Instances[slot];
|
|
|
|
// Were there any arguments specified?
|
|
|
|
if (top > 5)
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Grab a pointer to the arguments array
|
|
|
|
Argument * args = inst.mArgv;
|
|
|
|
// Reset the argument counter
|
|
|
|
inst.mArgc = 0;
|
|
|
|
// Grab the specified arguments from the stack
|
|
|
|
for (SQInteger i = 6; i <= top; ++i)
|
2016-05-24 06:24:21 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
res = sq_getstackobj(vm, i, &(args[inst.mArgc].mObj));
|
|
|
|
// Validate the result
|
|
|
|
if (SQ_FAILED(res))
|
|
|
|
{
|
|
|
|
// Clear previous arguments
|
|
|
|
inst.Clear();
|
|
|
|
// Propagate the error
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
// Keep a strong reference to the argument
|
|
|
|
sq_addref(vm, &(args[inst.mArgc].mObj));
|
|
|
|
// Increase the argument counter
|
|
|
|
++inst.mArgc;
|
2016-05-24 06:24:21 +02:00
|
|
|
}
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// Attempt to retrieve the routine from the stack and associate it with the slot
|
|
|
|
try
|
2016-05-22 05:20:38 +02:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
Var< Routine * >(vm, -1).value->m_Slot = ConvTo< Uint32 >::From(slot);
|
2016-05-22 05:20:38 +02:00
|
|
|
}
|
2016-11-17 22:10:31 +01:00
|
|
|
catch (const Sqrat::Exception & e)
|
2016-03-12 07:47:50 +01:00
|
|
|
{
|
2016-11-17 22:10:31 +01:00
|
|
|
// Clear extracted arguments
|
|
|
|
inst.Clear();
|
|
|
|
// Now it's safe to throw the error
|
|
|
|
return sq_throwerror(vm, "Unable to create the routine instance");
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
2016-02-21 08:25:46 +01:00
|
|
|
|
2016-11-17 22:10:31 +01:00
|
|
|
// Alright, at this point we can initialize the slot
|
2020-03-22 05:53:04 +01:00
|
|
|
inst.Init(env, func, obj, intrv, static_cast< Iterator >(itr));
|
2016-11-17 22:10:31 +01:00
|
|
|
// Now initialize the timer
|
|
|
|
s_Intervals[slot] = intrv;
|
|
|
|
// We have the created routine on the stack, so let's return it
|
|
|
|
return 1;
|
2016-03-12 07:47:50 +01:00
|
|
|
}
|
|
|
|
|
2018-07-29 09:47:31 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2019-02-17 16:23:59 +01:00
|
|
|
bool Routine::IsWithTag(StackStrF & tag)
|
2018-07-29 09:47:31 +02:00
|
|
|
{
|
|
|
|
// Is the specified tag valid?
|
|
|
|
if (tag.mPtr != nullptr)
|
|
|
|
{
|
|
|
|
// Iterate routine list
|
|
|
|
for (const auto & r : s_Instances)
|
|
|
|
{
|
2020-03-22 05:53:04 +01:00
|
|
|
if (!r.mInst.IsNull() && r.mTag == tag.mPtr)
|
2018-07-29 09:47:31 +02:00
|
|
|
{
|
|
|
|
return true; // Yup, we're doing this
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Unable to find such routine
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-26 18:59:34 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
bool Routine::TerminateWithTag(StackStrF & tag)
|
|
|
|
{
|
|
|
|
// Is the specified tag valid?
|
|
|
|
if (tag.mPtr != nullptr)
|
|
|
|
{
|
|
|
|
// Iterate routine list
|
|
|
|
for (auto & r : s_Instances)
|
|
|
|
{
|
2020-03-22 05:53:04 +01:00
|
|
|
if (!r.mInst.IsNull() && r.mTag == tag.mPtr)
|
2019-07-26 18:59:34 +02:00
|
|
|
{
|
|
|
|
r.Terminate(); // Yup, we're doing this
|
|
|
|
return true; // A routine was terminated
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Unable to find such routine
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-05-22 05:20:38 +02:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Forward the call to process routines.
|
|
|
|
*/
|
|
|
|
void ProcessRoutines()
|
|
|
|
{
|
|
|
|
Routine::Process();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Forward the call to initialize routines.
|
|
|
|
*/
|
|
|
|
void InitializeRoutines()
|
|
|
|
{
|
|
|
|
Routine::Initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Forward the call to terminate routines.
|
|
|
|
*/
|
|
|
|
void TerminateRoutines()
|
|
|
|
{
|
|
|
|
Routine::Deinitialize();
|
|
|
|
}
|
|
|
|
|
2016-02-21 08:25:46 +01:00
|
|
|
// ================================================================================================
|
|
|
|
void Register_Routine(HSQUIRRELVM vm)
|
|
|
|
{
|
2016-11-15 20:43:02 +01:00
|
|
|
RootTable(vm).Bind(Typename::Str,
|
|
|
|
Class< Routine, NoConstructor< Routine > >(vm, Typename::Str)
|
2016-06-03 20:26:19 +02:00
|
|
|
// Meta-methods
|
2016-11-15 20:43:02 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
|
|
|
.Func(_SC("_tostring"), &Routine::ToString)
|
2016-05-22 05:20:38 +02:00
|
|
|
// Properties
|
2016-03-12 07:47:50 +01:00
|
|
|
.Prop(_SC("Tag"), &Routine::GetTag, &Routine::SetTag)
|
2016-11-17 22:10:31 +01:00
|
|
|
.Prop(_SC("Env"), &Routine::GetEnv, &Routine::SetEnv)
|
|
|
|
.Prop(_SC("Func"), &Routine::GetFunc, &Routine::SetFunc)
|
2016-03-12 07:47:50 +01:00
|
|
|
.Prop(_SC("Data"), &Routine::GetData, &Routine::SetData)
|
2016-02-21 08:25:46 +01:00
|
|
|
.Prop(_SC("Interval"), &Routine::GetInterval, &Routine::SetInterval)
|
|
|
|
.Prop(_SC("Iterations"), &Routine::GetIterations, &Routine::SetIterations)
|
|
|
|
.Prop(_SC("Suspended"), &Routine::GetSuspended, &Routine::SetSuspended)
|
2018-01-28 21:45:09 +01:00
|
|
|
.Prop(_SC("Quiet"), &Routine::GetQuiet, &Routine::SetQuiet)
|
|
|
|
.Prop(_SC("Endure"), &Routine::GetEndure, &Routine::SetEndure)
|
2016-11-17 22:10:31 +01:00
|
|
|
.Prop(_SC("Arguments"), &Routine::GetArguments)
|
|
|
|
// Member Methods
|
2019-07-26 18:59:34 +02:00
|
|
|
.FmtFunc(_SC("SetTag"), &Routine::ApplyTag)
|
2019-06-01 21:49:24 +02:00
|
|
|
.Func(_SC("SetData"), &Routine::ApplyData)
|
|
|
|
.Func(_SC("SetInterval"), &Routine::ApplyInterval)
|
|
|
|
.Func(_SC("SetIterations"), &Routine::ApplyIterations)
|
|
|
|
.Func(_SC("SetSuspended"), &Routine::ApplySuspended)
|
|
|
|
.Func(_SC("SetQuiet"), &Routine::AppplyQuiet)
|
|
|
|
.Func(_SC("SetEndure"), &Routine::ApplyEndure)
|
2016-02-21 08:25:46 +01:00
|
|
|
.Func(_SC("Terminate"), &Routine::Terminate)
|
2016-11-17 22:10:31 +01:00
|
|
|
.Func(_SC("GetArgument"), &Routine::GetArgument)
|
2019-07-26 18:59:34 +02:00
|
|
|
.Func(_SC("DropEnv"), &Routine::DropEnv)
|
2020-04-02 23:29:17 +02:00
|
|
|
.StaticFunc(_SC("UsedCount"), &Routine::GetUsed)
|
2020-04-10 07:30:22 +02:00
|
|
|
.StaticFunc(_SC("AreSilenced"), &Routine::GetSilenced)
|
|
|
|
.StaticFunc(_SC("SetSilenced"), &Routine::SetSilenced)
|
2016-02-21 08:25:46 +01:00
|
|
|
);
|
2016-11-17 22:10:31 +01:00
|
|
|
// Global functions
|
|
|
|
RootTable(vm).SquirrelFunc(_SC("SqRoutine"), &Routine::Create);
|
|
|
|
RootTable(vm).FmtFunc(_SC("SqFindRoutineByTag"), &Routine::FindByTag);
|
2018-07-29 09:47:31 +02:00
|
|
|
RootTable(vm).FmtFunc(_SC("SqIsRoutineWithTag"), &Routine::IsWithTag);
|
2019-07-26 18:59:34 +02:00
|
|
|
RootTable(vm).FmtFunc(_SC("SqTerminateRoutineWithTag"), &Routine::TerminateWithTag);
|
2016-02-21 08:25:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|