mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-07-09 01:57:09 +02:00
Update the Vector2 type to use the new dynamic dispatching system for metamethods.
This commit is contained in:
@@ -254,6 +254,30 @@ struct Vector2
|
||||
*/
|
||||
Int32 Cmp(const Vector2 & v) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script engine to compare an instance of this type with a scalar value.
|
||||
*/
|
||||
Int32 Cmp(Value s) const
|
||||
{
|
||||
return Cmp(Vector2(s));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script engine to compare an instance of this type with a scalar value.
|
||||
*/
|
||||
Int32 Cmp(Int32 s) const
|
||||
{
|
||||
return Cmp(Vector2(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(Vector2(static_cast< Value >(0)));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Used by the script engine to convert an instance of this type to a string.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user