summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYongDo-Hyun <froster12@naver.com>2025-12-27 13:05:30 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-03-27 19:57:09 +0300
commitb6d496b1e83853cd272a8ffdea273c59bbf4b87c (patch)
tree249509918badba23d7d45af345ef7c2a06212b44 /include
parent37a3f01be6fb37d6cb04ae12216b5d74cef2aca9 (diff)
downloadProject-Tick-b6d496b1e83853cd272a8ffdea273c59bbf4b87c.tar.gz
Project-Tick-b6d496b1e83853cd272a8ffdea273c59bbf4b87c.zip
feat: add numeric tag creation methods and corresponding tests for value assignments
Signed-off-by: YongDo-Hyun <froster12@naver.com>
Diffstat (limited to 'include')
-rw-r--r--include/tag.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tag.h b/include/tag.h
index 0cb3c82c95..ac3b49fa3a 100644
--- a/include/tag.h
+++ b/include/tag.h
@@ -123,6 +123,16 @@ public:
* @throw std::invalid_argument if the type is not valid (e.g. End or Null)
*/
static std::unique_ptr<tag> create(tag_type type);
+ /**
+ * @brief Constructs a numeric tag of the given type and value
+ * @throw std::invalid_argument if the type is not numeric
+ */
+ static std::unique_ptr<tag> create(tag_type type, int8_t val);
+ static std::unique_ptr<tag> create(tag_type type, int16_t val);
+ static std::unique_ptr<tag> create(tag_type type, int32_t val);
+ static std::unique_ptr<tag> create(tag_type type, int64_t val);
+ static std::unique_ptr<tag> create(tag_type type, float val);
+ static std::unique_ptr<tag> create(tag_type type, double val);
friend NBT_EXPORT bool operator==(const tag& lhs, const tag& rhs);
friend NBT_EXPORT bool operator!=(const tag& lhs, const tag& rhs);