summaryrefslogtreecommitdiffstats
path: root/src/variant/vector2i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/variant/vector2i.cpp')
-rw-r--r--src/variant/vector2i.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/variant/vector2i.cpp b/src/variant/vector2i.cpp
index fa2d3ab..ed9d5ad 100644
--- a/src/variant/vector2i.cpp
+++ b/src/variant/vector2i.cpp
@@ -28,16 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#include <godot_cpp/variant/vector2i.hpp>
+
#include <godot_cpp/core/error_macros.hpp>
#include <godot_cpp/variant/string.hpp>
-#include <godot_cpp/variant/vector2i.hpp>
+#include <godot_cpp/variant/vector2.hpp>
namespace godot {
-Vector2i::operator String() const {
- return String::num(x, 0) + ", " + String::num(y, 0);
-}
-
Vector2i Vector2i::operator+(const Vector2i &p_v) const {
return Vector2i(x + p_v.x, y + p_v.y);
}
@@ -107,4 +105,12 @@ bool Vector2i::operator!=(const Vector2i &p_vec2) const {
return x != p_vec2.x || y != p_vec2.y;
}
+Vector2i::operator String() const {
+ return String::num(x, 0) + ", " + String::num(y, 0);
+}
+
+Vector2i::operator Vector2() const {
+ return Vector2((real_t)x, (real_t)y);
+}
+
} // namespace godot