diff options
author | rtk0c <[email protected]> | 2021-09-06 00:15:35 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-09-06 00:15:35 -0700 |
commit | 04653742243e4bb6452108cfd0fef2f4afd8f23b (patch) | |
tree | a4a5e0cc8d16ffe78859fab9ee5e487a7d22d81e /core/src/Utils/Vector.hpp | |
parent | 70e00f817e9596a746800ba4afec2b7c4ca25142 (diff) |
Fix all compile errors, remove OperateIOProxy requirement from DataStream api
Diffstat (limited to 'core/src/Utils/Vector.hpp')
-rw-r--r-- | core/src/Utils/Vector.hpp | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/core/src/Utils/Vector.hpp b/core/src/Utils/Vector.hpp index 3d4d251..4d3f3b3 100644 --- a/core/src/Utils/Vector.hpp +++ b/core/src/Utils/Vector.hpp @@ -1,5 +1,7 @@ #pragma once +#include "Utils/IO/DataStream.hpp" + template <class T> struct Vec2 { @@ -15,11 +17,16 @@ struct Vec2 }; } - template <class TProxy> - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) { - proxy.Value(x); - proxy.Value(y); + stream.Value(x); + stream.Value(y); + } + + void WriteToDataStream(OutputDataStream& stream) const + { + stream.Value(x); + stream.Value(y); } friend constexpr bool operator==(const Vec2& a, const Vec2& b) = default; @@ -55,12 +62,18 @@ struct Vec3 }; } - template <class TProxy> - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) + { + stream.Value(x); + stream.Value(y); + stream.Value(z); + } + + void WriteToDataStream(OutputDataStream& stream) const { - proxy.Value(x); - proxy.Value(y); - proxy.Value(z); + stream.Value(x); + stream.Value(y); + stream.Value(z); } friend constexpr bool operator==(const Vec3& a, const Vec3& b) = default; @@ -98,13 +111,20 @@ struct Vec4 }; } - template <class TProxy> - void OperateIOProxy(TProxy& proxy) + void ReadFromDataStream(InputDataStream& stream) + { + stream.Value(x); + stream.Value(y); + stream.Value(z); + stream.Value(w); + } + + void WriteToDataStream(OutputDataStream& stream) const { - proxy.Value(x); - proxy.Value(y); - proxy.Value(z); - proxy.Value(w); + stream.Value(x); + stream.Value(y); + stream.Value(z); + stream.Value(w); } friend constexpr bool operator==(const Vec4& a, const Vec4& b) = default; |