From 64e184d6c5cd1e10a2ad04fa23c60d942eb4a57d Mon Sep 17 00:00:00 2001 From: Michal Stachowicz Date: Wed, 18 Sep 2024 21:27:19 +0100 Subject: [PATCH] Added Serialisation functions to Label. Renamed a member to snake_case. --- CMakeLists.txt | 1 + source/Component/Label.cpp | 18 ++++++++++++++++++ source/Component/Label.hpp | 11 ++++++++--- source/UI/Editor.cpp | 4 ++-- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 source/Component/Label.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a13d004c..80973c1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,7 @@ source/Component/Collider.hpp source/Component/Input.cpp source/Component/Input.hpp source/Component/Label.hpp +source/Component/Label.cpp source/Component/Mesh.cpp source/Component/Mesh.hpp source/Component/ParticleEmitter.hpp diff --git a/source/Component/Label.cpp b/source/Component/Label.cpp new file mode 100644 index 00000000..3dff2789 --- /dev/null +++ b/source/Component/Label.cpp @@ -0,0 +1,18 @@ +#include "Label.hpp" + +#include "Utility/Serialise.hpp" + +namespace Component +{ + void Label::serialise(std::ostream& p_out, uint16_t p_version, const Label& p_label) + { + Utility::write_binary(p_out, p_version, p_label.m_name); + } + Label Label::deserialise(std::istream& p_in, uint16_t p_version) + { + Label label(""); + Utility::read_binary(p_in, p_version, label.m_name); + return label; + } + static_assert(Utility::Is_Serializable_v