diff --git a/source/Base/AABB.cpp b/source/Base/AABB.cpp index 1b316dc9..bd99cc35 100644 --- a/source/Base/AABB.cpp +++ b/source/Base/AABB.cpp @@ -450,8 +450,6 @@ void Register_AABB(HSQUIRRELVM vm) .Ctor< Val, Val, Val >() .Ctor< Val, Val, Val, Val, Val, Val >() .Ctor< const Vector3 &, const Vector3 & >() - // Static Members - .SetStaticValue(_SC("Delim"), &AABB::Delim) // Member Variables .Var(_SC("min"), &AABB::min) .Var(_SC("max"), &AABB::max) @@ -485,6 +483,9 @@ void Register_AABB(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const AABB & (*)(CSStr) >(_SC("FromStr"), &AABB::Get) .StaticOverload< const AABB & (*)(CSStr, SQChar) >(_SC("FromStr"), &AABB::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< AABB >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< AABB >) // Operator Exposure .Func< AABB & (AABB::*)(const AABB &) >(_SC("opAddAssign"), &AABB::operator +=) .Func< AABB & (AABB::*)(const AABB &) >(_SC("opSubAssign"), &AABB::operator -=) diff --git a/source/Base/Circle.cpp b/source/Base/Circle.cpp index bfb51ec5..f8128ddd 100644 --- a/source/Base/Circle.cpp +++ b/source/Base/Circle.cpp @@ -506,8 +506,6 @@ void Register_Circle(HSQUIRRELVM vm) .Ctor< Val >() .Ctor< const Vector2 &, Val >() .Ctor< Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Circle::Delim) // Member Variables .Var(_SC("pos"), &Circle::pos) .Var(_SC("rad"), &Circle::rad) @@ -539,6 +537,9 @@ void Register_Circle(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Circle & (*)(CSStr) >(_SC("FromStr"), &Circle::Get) .StaticOverload< const Circle & (*)(CSStr, SQChar) >(_SC("FromStr"), &Circle::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Circle >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Circle >) // Operator Exposure .Func< Circle & (Circle::*)(const Circle &) >(_SC("opAddAssign"), &Circle::operator +=) .Func< Circle & (Circle::*)(const Circle &) >(_SC("opSubAssign"), &Circle::operator -=) diff --git a/source/Base/Color3.cpp b/source/Base/Color3.cpp index 912c6b13..a6eff2e3 100644 --- a/source/Base/Color3.cpp +++ b/source/Base/Color3.cpp @@ -650,8 +650,6 @@ void Register_Color3(HSQUIRRELVM vm) .Ctor() .Ctor< Val >() .Ctor< Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Color3::Delim) // Member Variables .Var(_SC("r"), &Color3::r) .Var(_SC("g"), &Color3::g) @@ -692,6 +690,9 @@ void Register_Color3(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Color3 & (*)(CSStr) >(_SC("FromStr"), &Color3::Get) .StaticOverload< const Color3 & (*)(CSStr, SQChar) >(_SC("FromStr"), &Color3::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Color3 >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Color3 >) // Operator Exposure .Func< Color3 & (Color3::*)(const Color3 &) >(_SC("opAddAssign"), &Color3::operator +=) .Func< Color3 & (Color3::*)(const Color3 &) >(_SC("opSubAssign"), &Color3::operator -=) diff --git a/source/Base/Color4.cpp b/source/Base/Color4.cpp index ec7b6ce7..c8d62393 100644 --- a/source/Base/Color4.cpp +++ b/source/Base/Color4.cpp @@ -709,8 +709,6 @@ void Register_Color4(HSQUIRRELVM vm) .Ctor< Val >() .Ctor< Val, Val, Val >() .Ctor< Val, Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Color4::Delim) // Member Variables .Var(_SC("r"), &Color4::r) .Var(_SC("g"), &Color4::g) @@ -754,6 +752,9 @@ void Register_Color4(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Color4 & (*)(CSStr) >(_SC("FromStr"), &Color4::Get) .StaticOverload< const Color4 & (*)(CSStr, SQChar) >(_SC("FromStr"), &Color4::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Color4 >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Color4 >) // Operator Exposure .Func< Color4 & (Color4::*)(const Color4 &) >(_SC("opAddAssign"), &Color4::operator +=) .Func< Color4 & (Color4::*)(const Color4 &) >(_SC("opSubAssign"), &Color4::operator -=) diff --git a/source/Base/Quaternion.cpp b/source/Base/Quaternion.cpp index 1037881f..edba6ae3 100644 --- a/source/Base/Quaternion.cpp +++ b/source/Base/Quaternion.cpp @@ -507,8 +507,6 @@ void Register_Quaternion(HSQUIRRELVM vm) .Ctor< Val >() .Ctor< Val, Val, Val >() .Ctor< Val, Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Quaternion::Delim) // Member Variables .Var(_SC("x"), &Quaternion::x) .Var(_SC("y"), &Quaternion::y) @@ -548,6 +546,9 @@ void Register_Quaternion(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Quaternion & (*)(CSStr) >(_SC("FromStr"), &Quaternion::Get) .StaticOverload< const Quaternion & (*)(CSStr, SQChar) >(_SC("FromStr"), &Quaternion::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Quaternion >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Quaternion >) // Operator Exposure .Func< Quaternion & (Quaternion::*)(const Quaternion &) >(_SC("opAddAssign"), &Quaternion::operator +=) .Func< Quaternion & (Quaternion::*)(const Quaternion &) >(_SC("opSubAssign"), &Quaternion::operator -=) diff --git a/source/Base/Shared.hpp b/source/Base/Shared.hpp index af0ade4a..4304d034 100644 --- a/source/Base/Shared.hpp +++ b/source/Base/Shared.hpp @@ -280,6 +280,22 @@ public: } }; +/* ------------------------------------------------------------------------------------------------ + * Retrieve the string delimiter of a base type. +*/ +template < typename T > inline SQInteger SqGetDelimiter() +{ + return T::Delim; +} + +/* ------------------------------------------------------------------------------------------------ + * Modify the string delimiter of a base type. +*/ +template < typename T > inline void SqSetDelimiter(SQInteger c) +{ + T::Delim = ConvTo< SQChar >::From(c); +} + } // Namespace:: SqMod #endif // _BASE_SHARED_HPP_ diff --git a/source/Base/Sphere.cpp b/source/Base/Sphere.cpp index a810e5ae..ec9d0f46 100644 --- a/source/Base/Sphere.cpp +++ b/source/Base/Sphere.cpp @@ -507,8 +507,6 @@ void Register_Sphere(HSQUIRRELVM vm) .Ctor< Val >() .Ctor< const Vector3 &, Val >() .Ctor< Val, Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Sphere::Delim) // Member Variables .Var(_SC("pos"), &Sphere::pos) .Var(_SC("rad"), &Sphere::rad) @@ -540,6 +538,9 @@ void Register_Sphere(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Sphere & (*)(CSStr) >(_SC("FromStr"), &Sphere::Get) .StaticOverload< const Sphere & (*)(CSStr, SQChar) >(_SC("FromStr"), &Sphere::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Sphere >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Sphere >) // Operator Exposure .Func< Sphere & (Sphere::*)(const Sphere &) >(_SC("opAddAssign"), &Sphere::operator +=) .Func< Sphere & (Sphere::*)(const Sphere &) >(_SC("opSubAssign"), &Sphere::operator -=) diff --git a/source/Base/Vector2.cpp b/source/Base/Vector2.cpp index b2770edb..3e746987 100644 --- a/source/Base/Vector2.cpp +++ b/source/Base/Vector2.cpp @@ -422,8 +422,6 @@ void Register_Vector2(HSQUIRRELVM vm) .Ctor() .Ctor< Val >() .Ctor< Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Vector2::Delim) // Member Variables .Var(_SC("x"), &Vector2::x) .Var(_SC("y"), &Vector2::y) @@ -457,6 +455,9 @@ void Register_Vector2(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Vector2 & (*)(CSStr) >(_SC("FromStr"), &Vector2::Get) .StaticOverload< const Vector2 & (*)(CSStr, SQChar) >(_SC("FromStr"), &Vector2::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Vector2 >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Vector2 >) // Operator Exposure .Func< Vector2 & (Vector2::*)(const Vector2 &) >(_SC("opAddAssign"), &Vector2::operator +=) .Func< Vector2 & (Vector2::*)(const Vector2 &) >(_SC("opSubAssign"), &Vector2::operator -=) diff --git a/source/Base/Vector2i.cpp b/source/Base/Vector2i.cpp index da23aa18..48c89f09 100644 --- a/source/Base/Vector2i.cpp +++ b/source/Base/Vector2i.cpp @@ -548,8 +548,6 @@ void Register_Vector2i(HSQUIRRELVM vm) .Ctor() .Ctor< Val >() .Ctor< Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Vector2i::Delim) // Member Variables .Var(_SC("x"), &Vector2i::x) .Var(_SC("y"), &Vector2i::y) @@ -583,6 +581,9 @@ void Register_Vector2i(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Vector2i & (*)(CSStr) >(_SC("FromStr"), &Vector2i::Get) .StaticOverload< const Vector2i & (*)(CSStr, SQChar) >(_SC("FromStr"), &Vector2i::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Vector2i >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Vector2i >) // Operator Exposure .Func< Vector2i & (Vector2i::*)(const Vector2i &) >(_SC("opAddAssign"), &Vector2i::operator +=) .Func< Vector2i & (Vector2i::*)(const Vector2i &) >(_SC("opSubAssign"), &Vector2i::operator -=) diff --git a/source/Base/Vector3.cpp b/source/Base/Vector3.cpp index d1814286..46644fa8 100644 --- a/source/Base/Vector3.cpp +++ b/source/Base/Vector3.cpp @@ -456,8 +456,6 @@ void Register_Vector3(HSQUIRRELVM vm) .Ctor() .Ctor< Val >() .Ctor< Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Vector3::Delim) // Member Variables .Var(_SC("x"), &Vector3::x) .Var(_SC("y"), &Vector3::y) @@ -494,6 +492,9 @@ void Register_Vector3(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Vector3 & (*)(CSStr) >(_SC("FromStr"), &Vector3::Get) .StaticOverload< const Vector3 & (*)(CSStr, SQChar) >(_SC("FromStr"), &Vector3::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Vector3 >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Vector3 >) // Operator Exposure .Func< Vector3 & (Vector3::*)(const Vector3 &) >(_SC("opAddAssign"), &Vector3::operator +=) .Func< Vector3 & (Vector3::*)(const Vector3 &) >(_SC("opSubAssign"), &Vector3::operator -=) diff --git a/source/Base/Vector4.cpp b/source/Base/Vector4.cpp index 345c5585..c9e603f8 100644 --- a/source/Base/Vector4.cpp +++ b/source/Base/Vector4.cpp @@ -504,8 +504,6 @@ void Register_Vector4(HSQUIRRELVM vm) .Ctor< Val >() .Ctor< Val, Val, Val >() .Ctor< Val, Val, Val, Val >() - // Static Members - .SetStaticValue(_SC("Delim"), &Vector4::Delim) // Member Variables .Var(_SC("x"), &Vector4::x) .Var(_SC("y"), &Vector4::y) @@ -545,6 +543,9 @@ void Register_Vector4(HSQUIRRELVM vm) // Static Overloads .StaticOverload< const Vector4 & (*)(CSStr) >(_SC("FromStr"), &Vector4::Get) .StaticOverload< const Vector4 & (*)(CSStr, SQChar) >(_SC("FromStr"), &Vector4::Get) + // Static Functions + .StaticFunc(_SC("GetDelimiter"), &SqGetDelimiter< Vector4 >) + .StaticFunc(_SC("SetDelimiter"), &SqSetDelimiter< Vector4 >) // Operator Exposure .Func< Vector4 & (Vector4::*)(const Vector4 &) >(_SC("opAddAssign"), &Vector4::operator +=) .Func< Vector4 & (Vector4::*)(const Vector4 &) >(_SC("opSubAssign"), &Vector4::operator -=)