2016-06-04 23:00:59 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
#include "Library/Numeric/Long.hpp"
|
2016-06-04 23:00:59 +02:00
|
|
|
#include "Library/Numeric/Random.hpp"
|
2016-08-24 23:19:53 +02:00
|
|
|
#include "Base/DynArg.hpp"
|
2016-06-04 23:00:59 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-06-05 02:53:58 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_DECL_TYPENAME(TypenameS, _SC("SLongInt"))
|
|
|
|
SQMOD_DECL_TYPENAME(TypenameU, _SC("ULongInt"))
|
2016-06-05 02:53:58 +02:00
|
|
|
|
2016-06-04 23:00:59 +02:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< signed long long >::LongInt(const SQChar * text)
|
2016-08-24 23:19:53 +02:00
|
|
|
: m_Data(0), m_Text()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = std::strtoll(text, nullptr, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< signed long long >::LongInt(const SQChar * text, uint32_t base)
|
2016-08-24 23:19:53 +02:00
|
|
|
: m_Data(0), m_Text()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
2016-08-24 23:19:53 +02:00
|
|
|
m_Data = std::strtoll(text, nullptr, base);
|
2016-06-04 23:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< signed long long > & LongInt< signed long long >::operator = (const SQChar * text)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = std::strtoll(text, nullptr, 10);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
const SQChar * LongInt< signed long long >::ToString()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
if (std::snprintf(m_Text, sizeof(m_Text), "%llu", m_Data) < 0)
|
|
|
|
{
|
|
|
|
m_Text[0] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_Text;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< signed long long >::Random()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomInt64();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< signed long long >::Random(Type n)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomInt64(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< signed long long >::Random(Type m, Type n)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomInt64(m, n);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< unsigned long long >::LongInt(const SQChar * text)
|
2016-08-24 23:19:53 +02:00
|
|
|
: m_Data(0), m_Text()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
2016-08-24 23:19:53 +02:00
|
|
|
m_Data = std::strtoull(text, nullptr, 10);
|
2016-06-04 23:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< unsigned long long >::LongInt(const SQChar * text, uint32_t base)
|
2016-08-24 23:19:53 +02:00
|
|
|
: m_Data(0), m_Text()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
2016-08-24 23:19:53 +02:00
|
|
|
m_Data = std::strtoull(text, nullptr, base);
|
2016-06-04 23:00:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
LongInt< unsigned long long > & LongInt< unsigned long long >::operator = (const SQChar * text)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = std::strtoull(text, nullptr, 10);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
const SQChar * LongInt< unsigned long long >::ToString()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
if (std::snprintf(m_Text, sizeof(m_Text), "%llu", m_Data) < 0)
|
|
|
|
{
|
|
|
|
m_Text[0] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_Text;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< unsigned long long >::Random()
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomUint64();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< unsigned long long >::Random(Type n)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomUint64(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
void LongInt< unsigned long long >::Random(Type m, Type n)
|
2016-06-04 23:00:59 +02:00
|
|
|
{
|
|
|
|
m_Data = GetRandomUint64(m, n);
|
|
|
|
}
|
|
|
|
|
2020-03-21 23:35:03 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
signed long long PopStackSLong(HSQUIRRELVM vm, SQInteger idx)
|
2020-03-21 23:35:03 +01:00
|
|
|
{
|
|
|
|
// Identify which type must be extracted
|
|
|
|
switch (sq_gettype(vm, idx))
|
|
|
|
{
|
|
|
|
case OT_INTEGER:
|
|
|
|
{
|
|
|
|
SQInteger val;
|
|
|
|
sq_getinteger(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return static_cast< signed long long >(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_FLOAT:
|
|
|
|
{
|
|
|
|
SQFloat val;
|
|
|
|
sq_getfloat(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< signed long long >::From(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_BOOL:
|
|
|
|
{
|
|
|
|
SQBool val;
|
|
|
|
sq_getbool(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return static_cast< signed long long >(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_STRING:
|
|
|
|
{
|
2021-01-30 07:51:39 +01:00
|
|
|
const SQChar * val = nullptr;
|
2020-03-21 23:35:03 +01:00
|
|
|
// Attempt to retrieve and convert the string
|
|
|
|
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
|
|
|
{
|
|
|
|
return std::strtoll(val, nullptr, 10);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
case OT_ARRAY:
|
|
|
|
case OT_TABLE:
|
|
|
|
case OT_CLASS:
|
|
|
|
case OT_USERDATA:
|
|
|
|
{
|
2021-01-31 23:33:12 +01:00
|
|
|
return static_cast< signed long long >(sq_getsize(vm, idx));
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_INSTANCE:
|
|
|
|
{
|
|
|
|
// Attempt to treat the value as a signed long instance
|
|
|
|
try
|
|
|
|
{
|
|
|
|
return Var< const SLongInt & >(vm, idx).value.GetNum();
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
// Just ignore it...
|
|
|
|
}
|
|
|
|
// Attempt to treat the value as a unsigned long instance
|
|
|
|
try
|
|
|
|
{
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< signed long long >::From(Var< const ULongInt & >(vm, idx).value.GetNum());
|
2020-03-21 23:35:03 +01:00
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
// Just ignore it...
|
|
|
|
}
|
|
|
|
// Attempt to get the size of the instance as a fall back
|
2021-01-31 23:33:12 +01:00
|
|
|
return static_cast< signed long long >(sq_getsize(vm, idx));
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
// Default to 0
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-31 23:33:12 +01:00
|
|
|
unsigned long long PopStackULong(HSQUIRRELVM vm, SQInteger idx)
|
2020-03-21 23:35:03 +01:00
|
|
|
{
|
|
|
|
// Identify which type must be extracted
|
|
|
|
switch (sq_gettype(vm, idx))
|
|
|
|
{
|
|
|
|
case OT_INTEGER:
|
|
|
|
{
|
|
|
|
SQInteger val;
|
|
|
|
sq_getinteger(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_FLOAT:
|
|
|
|
{
|
|
|
|
SQFloat val;
|
|
|
|
sq_getfloat(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_BOOL:
|
|
|
|
{
|
|
|
|
SQBool val;
|
|
|
|
sq_getbool(vm, idx, &val);
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(val);
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_STRING:
|
|
|
|
{
|
2021-01-30 07:51:39 +01:00
|
|
|
const SQChar * val = nullptr;
|
2020-03-21 23:35:03 +01:00
|
|
|
// Attempt to retrieve and convert the string
|
|
|
|
if (SQ_SUCCEEDED(sq_getstring(vm, idx, &val)) && val != nullptr && *val != '\0')
|
|
|
|
{
|
|
|
|
return std::strtoull(val, nullptr, 10);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
case OT_ARRAY:
|
|
|
|
case OT_TABLE:
|
|
|
|
case OT_CLASS:
|
|
|
|
case OT_USERDATA:
|
|
|
|
{
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(sq_getsize(vm, idx));
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
case OT_INSTANCE:
|
|
|
|
{
|
|
|
|
// Attempt to treat the value as a signed long instance
|
|
|
|
try
|
|
|
|
{
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(Var< const SLongInt & >(vm, idx).value.GetNum());
|
2020-03-21 23:35:03 +01:00
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
// Just ignore it...
|
|
|
|
}
|
|
|
|
// Attempt to treat the value as a unsigned long instance
|
|
|
|
try
|
|
|
|
{
|
|
|
|
return Var< const ULongInt & >(vm, idx).value.GetNum();
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
// Just ignore it...
|
|
|
|
}
|
|
|
|
// Attempt to get the size of the instance as a fall back
|
2021-01-31 23:33:12 +01:00
|
|
|
return ConvTo< unsigned long long >::From(sq_getsize(vm, idx));
|
2021-01-30 07:51:39 +01:00
|
|
|
}
|
2020-03-21 23:35:03 +01:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
// Default to 0
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-22 08:16:40 +01:00
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
const SLongInt & GetSLongInt()
|
|
|
|
{
|
|
|
|
static SLongInt l;
|
|
|
|
l.SetNum(0);
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
2021-01-31 23:33:12 +01:00
|
|
|
const SLongInt & GetSLongInt(signed long long n)
|
2020-03-22 08:16:40 +01:00
|
|
|
{
|
|
|
|
static SLongInt l;
|
|
|
|
l.SetNum(n);
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
const SLongInt & GetSLongInt(const SQChar * s)
|
2020-03-22 08:16:40 +01:00
|
|
|
{
|
|
|
|
static SLongInt l;
|
|
|
|
l = s;
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ULongInt & GetULongInt()
|
|
|
|
{
|
|
|
|
static ULongInt l;
|
|
|
|
l.SetNum(0);
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
2021-01-31 23:33:12 +01:00
|
|
|
const ULongInt & GetULongInt(unsigned long long n)
|
2020-03-22 08:16:40 +01:00
|
|
|
{
|
|
|
|
static ULongInt l;
|
|
|
|
l.SetNum(n);
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
const ULongInt & GetULongInt(const SQChar * s)
|
2020-03-22 08:16:40 +01:00
|
|
|
{
|
|
|
|
static ULongInt l;
|
|
|
|
l = s;
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
2016-06-04 23:00:59 +02:00
|
|
|
// ================================================================================================
|
|
|
|
void Register_LongInt(HSQUIRRELVM vm)
|
|
|
|
{
|
2016-11-15 20:55:03 +01:00
|
|
|
RootTable(vm).Bind(TypenameS::Str,
|
|
|
|
Class< SLongInt >(vm, TypenameS::Str)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Constructors
|
2016-06-04 23:00:59 +02:00
|
|
|
.Ctor()
|
|
|
|
.Ctor< SLongInt::Type >()
|
2021-01-30 07:51:39 +01:00
|
|
|
.template Ctor< const char *, SQInteger >()
|
2016-06-05 02:53:58 +02:00
|
|
|
// Properties
|
2016-06-04 23:00:59 +02:00
|
|
|
.Prop(_SC("Str"), &SLongInt::GetCStr, &SLongInt::SetStr)
|
|
|
|
.Prop(_SC("Num"), &SLongInt::GetSNum, &SLongInt::SetNum)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Core Meta-methods
|
2021-01-30 07:51:39 +01:00
|
|
|
.SquirrelFunc(_SC("cmp"), &SqDynArgFwd< SqDynArgCmpFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
2016-11-15 20:42:11 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &TypenameS::Fn)
|
|
|
|
.Func(_SC("_tostring"), &SLongInt::ToString)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Core Functions
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func(_SC("tointeger"), &SLongInt::ToSqInteger)
|
|
|
|
.Func(_SC("tofloat"), &SLongInt::ToSqFloat)
|
|
|
|
.Func(_SC("tostring"), &SLongInt::ToSqString)
|
|
|
|
.Func(_SC("tobool"), &SLongInt::ToSqBool)
|
|
|
|
.Func(_SC("tochar"), &SLongInt::ToSqChar)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Meta-methods
|
2021-01-30 07:51:39 +01:00
|
|
|
.SquirrelFunc(_SC("_add"), &SqDynArgFwd< SqDynArgAddFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
|
|
|
.SquirrelFunc(_SC("_sub"), &SqDynArgFwd< SqDynArgSubFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
|
|
|
.SquirrelFunc(_SC("_mul"), &SqDynArgFwd< SqDynArgMulFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
|
|
|
.SquirrelFunc(_SC("_div"), &SqDynArgFwd< SqDynArgDivFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
|
|
|
.SquirrelFunc(_SC("_modulo"), &SqDynArgFwd< SqDynArgModFn< SLongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, SLongInt, ULongInt >)
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func< SLongInt (SLongInt::*)(void) const >(_SC("_unm"), &SLongInt::operator -)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Functions
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func(_SC("GetStr"), &SLongInt::GetCStr)
|
|
|
|
.Func(_SC("SetStr"), &SLongInt::SetStr)
|
|
|
|
.Func(_SC("GetNum"), &SLongInt::GetSNum)
|
|
|
|
.Func(_SC("SetNum"), &SLongInt::SetNum)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Overloads
|
2016-06-04 23:00:59 +02:00
|
|
|
.Overload< void (SLongInt::*)(void) >(_SC("Random"), &SLongInt::Random)
|
|
|
|
.Overload< void (SLongInt::*)(SLongInt::Type) >(_SC("Random"), &SLongInt::Random)
|
|
|
|
.Overload< void (SLongInt::*)(SLongInt::Type, SLongInt::Type) >(_SC("Random"), &SLongInt::Random)
|
|
|
|
);
|
|
|
|
|
2016-11-15 20:55:03 +01:00
|
|
|
RootTable(vm).Bind(TypenameU::Str,
|
|
|
|
Class< ULongInt >(vm, TypenameU::Str)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Constructors
|
2016-06-04 23:00:59 +02:00
|
|
|
.Ctor()
|
|
|
|
.Ctor< ULongInt::Type >()
|
2021-01-30 07:51:39 +01:00
|
|
|
.Ctor< const char *, SQInteger >()
|
2016-06-05 02:53:58 +02:00
|
|
|
// Properties
|
2016-06-04 23:00:59 +02:00
|
|
|
.Prop(_SC("Str"), &ULongInt::GetCStr, &ULongInt::SetStr)
|
|
|
|
.Prop(_SC("Num"), &ULongInt::GetSNum, &ULongInt::SetNum)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Core Meta-methods
|
2021-01-30 07:51:39 +01:00
|
|
|
.SquirrelFunc(_SC("cmp"), &SqDynArgFwd< SqDynArgCmpFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
2016-11-15 20:42:11 +01:00
|
|
|
.SquirrelFunc(_SC("_typename"), &TypenameU::Fn)
|
|
|
|
.Func(_SC("_tostring"), &ULongInt::ToString)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Core Functions
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func(_SC("tointeger"), &ULongInt::ToSqInteger)
|
|
|
|
.Func(_SC("tofloat"), &ULongInt::ToSqFloat)
|
|
|
|
.Func(_SC("tostring"), &ULongInt::ToSqString)
|
|
|
|
.Func(_SC("tobool"), &ULongInt::ToSqBool)
|
|
|
|
.Func(_SC("tochar"), &ULongInt::ToSqChar)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Meta-methods
|
2021-01-30 07:51:39 +01:00
|
|
|
.SquirrelFunc(_SC("_add"), &SqDynArgFwd< SqDynArgAddFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
|
|
|
.SquirrelFunc(_SC("_sub"), &SqDynArgFwd< SqDynArgSubFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
|
|
|
.SquirrelFunc(_SC("_mul"), &SqDynArgFwd< SqDynArgMulFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
|
|
|
.SquirrelFunc(_SC("_div"), &SqDynArgFwd< SqDynArgDivFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
|
|
|
.SquirrelFunc(_SC("_modulo"), &SqDynArgFwd< SqDynArgModFn< ULongInt >, SQInteger, SQFloat, bool, std::nullptr_t, const SQChar *, ULongInt, SLongInt >)
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func< ULongInt (ULongInt::*)(void) const >(_SC("_unm"), &ULongInt::operator -)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Functions
|
2016-06-04 23:00:59 +02:00
|
|
|
.Func(_SC("GetStr"), &ULongInt::GetCStr)
|
|
|
|
.Func(_SC("SetStr"), &ULongInt::SetStr)
|
|
|
|
.Func(_SC("GetNum"), &ULongInt::GetSNum)
|
|
|
|
.Func(_SC("SetNum"), &ULongInt::SetNum)
|
2016-06-05 02:53:58 +02:00
|
|
|
// Overloads
|
2016-06-04 23:00:59 +02:00
|
|
|
.Overload< void (ULongInt::*)(void) >(_SC("Random"), &ULongInt::Random)
|
|
|
|
.Overload< void (ULongInt::*)(ULongInt::Type) >(_SC("Random"), &ULongInt::Random)
|
|
|
|
.Overload< void (ULongInt::*)(ULongInt::Type, ULongInt::Type) >(_SC("Random"), &ULongInt::Random)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Namespace:: SqMod
|