diff options
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; |