From 48485981f0f39f053c5eb67662b0f89256de30b5 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 25 Jul 2016 00:32:35 +0300 Subject: [PATCH] Improve Circle method names to be more consistent with the rest of the basic types. --- source/Base/Circle.cpp | 18 +++++++++--------- source/Base/Circle.hpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/Base/Circle.cpp b/source/Base/Circle.cpp index 55d297c6..fa356546 100644 --- a/source/Base/Circle.cpp +++ b/source/Base/Circle.cpp @@ -387,9 +387,10 @@ void Circle::SetCircle(const Circle & nc) } // ------------------------------------------------------------------------------------------------ -void Circle::SetPosition(const Vector2 & np) +void Circle::SetCircleEx(Value nx, Value ny, Value nr) { - pos = np; + pos.SetVector2Ex(nx, ny); + rad = nr; } // ------------------------------------------------------------------------------------------------ @@ -400,16 +401,15 @@ void Circle::SetValues(const Vector2 & np, Value nr) } // ------------------------------------------------------------------------------------------------ -void Circle::SetPositionEx(Value nx, Value ny) +void Circle::SetPosition(const Vector2 & np) { - pos.SetVector2Ex(nx, ny); + pos = np; } // ------------------------------------------------------------------------------------------------ -void Circle::SetValuesEx(Value nx, Value ny, Value nr) +void Circle::SetPositionEx(Value nx, Value ny) { pos.SetVector2Ex(nx, ny); - rad = nr; } // ------------------------------------------------------------------------------------------------ @@ -527,7 +527,7 @@ const Circle & GetCircle(const Vector2 & pv, Float32 rv) const Circle & GetCircle(Float32 xv, Float32 yv, Float32 rv) { static Circle circle; - circle.SetValuesEx(xv, yv, rv); + circle.SetCircleEx(xv, yv, rv); return circle; } @@ -571,12 +571,12 @@ void Register_Circle(HSQUIRRELVM vm) // Member Methods .Func(_SC("SetRadius"), &Circle::SetRadius) .Func(_SC("SetCircle"), &Circle::SetCircle) + .Func(_SC("SetCircleEx"), &Circle::SetCircleEx) + .Func(_SC("SetValues"), &Circle::SetValues) .Func(_SC("SetPos"), &Circle::SetPosition) .Func(_SC("SetPosition"), &Circle::SetPosition) - .Func(_SC("SetValues"), &Circle::SetValues) .Func(_SC("SetPosEx"), &Circle::SetPositionEx) .Func(_SC("SetPositionEx"), &Circle::SetPositionEx) - .Func(_SC("SetValuesEx"), &Circle::SetValuesEx) .Func(_SC("SetStr"), &Circle::SetStr) .Func(_SC("Clear"), &Circle::Clear) // Member Overloads diff --git a/source/Base/Circle.hpp b/source/Base/Circle.hpp index 436ac962..61e230d9 100644 --- a/source/Base/Circle.hpp +++ b/source/Base/Circle.hpp @@ -327,9 +327,9 @@ struct Circle void SetCircle(const Circle & nc); /* -------------------------------------------------------------------------------------------- - * Set the position from the specified position. + * Set the specified position and radius. */ - void SetPosition(const Vector2 & np); + void SetCircleEx(Value nx, Value ny, Value nr); /* -------------------------------------------------------------------------------------------- * Set the specified position and radius. @@ -339,12 +339,12 @@ struct Circle /* -------------------------------------------------------------------------------------------- * Set the specified position. */ - void SetPositionEx(Value nx, Value ny); + void SetPosition(const Vector2 & np); /* -------------------------------------------------------------------------------------------- - * Set the specified position and radius. + * Set the specified position. */ - void SetValuesEx(Value nx, Value ny, Value nr); + void SetPositionEx(Value nx, Value ny); /* -------------------------------------------------------------------------------------------- * Set the values extracted from the specified string using the specified delimiter.