1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-07-09 01:57:09 +02:00

Update the Color3 type to use the new dynamic dispatching system for metamethods.

This commit is contained in:
Sandu Liviu Catalin
2016-08-24 23:17:09 +03:00
parent 64ed87f4b4
commit 778b6ea59d
2 changed files with 31 additions and 6 deletions
+24
View File
@@ -369,6 +369,30 @@ struct Color3
*/
Int32 Cmp(const Color3 & c) const;
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(Int32 s) const
{
return Cmp(Color3(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(Float32 s) const
{
return Cmp(Color3(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(std::nullptr_t) const
{
return Cmp(Color3(static_cast< Value >(0)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to convert an instance of this type to a string.
*/