mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-08-12 18:57:12 +02:00
Implement the pure typename meta-methods in chrono types using the standard method.
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQMODE_DECL_TYPENAME(Typename, _SC("SqTimer"))
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Timer::Timer()
|
||||
: m_Timestamp(Chrono::GetCurrentSysTime())
|
||||
@@ -67,11 +70,12 @@ Int64 Timer::GetElapsedTimeRaw() const
|
||||
// ================================================================================================
|
||||
void Register_ChronoTimer(HSQUIRRELVM vm, Table & /*cns*/)
|
||||
{
|
||||
RootTable(vm).Bind(_SC("SqTimer"), Class< Timer >(vm, _SC("SqChronoTimer"))
|
||||
RootTable(vm).Bind(Typename::Str, Class< Timer >(vm, Typename::Str)
|
||||
// Constructors
|
||||
.Ctor()
|
||||
.Ctor< const Timer & >()
|
||||
// Core Meta-methods
|
||||
.SquirrelFunc(_SC("_typename"), &Typename::Fn)
|
||||
.Func(_SC("_tostring"), &Timer::ToString)
|
||||
.Func(_SC("_cmp"), &Timer::Cmp)
|
||||
// Properties
|
||||
|
||||
Reference in New Issue
Block a user