From 70e00f817e9596a746800ba4afec2b7c4ca25142 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 4 Sep 2021 17:58:56 -0700 Subject: Migrate Template and TableTemplate to use DataStream --- core/src/Utils/Vector.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'core/src/Utils/Vector.hpp') diff --git a/core/src/Utils/Vector.hpp b/core/src/Utils/Vector.hpp index 7e71b73..3d4d251 100644 --- a/core/src/Utils/Vector.hpp +++ b/core/src/Utils/Vector.hpp @@ -15,6 +15,13 @@ struct Vec2 }; } + template + void OperateIOProxy(TProxy& proxy) + { + proxy.Value(x); + proxy.Value(y); + } + friend constexpr bool operator==(const Vec2& a, const Vec2& b) = default; friend constexpr Vec2 operator+(const Vec2& a, const Vec2& b) { return { a.x + b.x, a.y + b.y }; } @@ -48,6 +55,14 @@ struct Vec3 }; } + template + void OperateIOProxy(TProxy& proxy) + { + proxy.Value(x); + proxy.Value(y); + proxy.Value(z); + } + friend constexpr bool operator==(const Vec3& a, const Vec3& b) = default; friend constexpr Vec3 operator+(const Vec3& a, const Vec3& b) { return { a.x + b.x, a.y + b.y, a.z + b.z }; } @@ -83,6 +98,15 @@ struct Vec4 }; } + template + void OperateIOProxy(TProxy& proxy) + { + proxy.Value(x); + proxy.Value(y); + proxy.Value(z); + proxy.Value(w); + } + friend constexpr bool operator==(const Vec4& a, const Vec4& b) = default; friend constexpr Vec4 operator+(const Vec4& a, const Vec4& b) { return { a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w }; } -- cgit v1.2.3-70-g09d2