make BlockMaterial serializable

This commit is contained in:
MihailRis
2025-04-13 20:52:03 +03:00
parent 862ac496a8
commit 9e28b783fd
4 changed files with 26 additions and 9 deletions
+5 -2
View File
@@ -10,6 +10,7 @@
#include "maths/aabb.hpp"
#include "typedefs.hpp"
#include "util/EnumMetadata.hpp"
#include "interfaces/Serializable.hpp"
struct ParticlesPreset;
@@ -116,14 +117,16 @@ VC_ENUM_END
using BoxModel = AABB;
/// @brief Common kit of block properties applied to groups of blocks
struct BlockMaterial {
struct BlockMaterial : Serializable {
std::string name;
std::string stepsSound;
std::string placeSound;
std::string breakSound;
std::string hitSound;
dv::value serialize() const;
dv::value toTable() const; // for compatibility
dv::value serialize() const override;
void deserialize(const dv::value& src) override;
};
/// @brief Block properties definition