From 8c5b719469bc61e33a451d9b3aeb66c7b0a6d68e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 19 Jul 2024 03:51:23 -0400 Subject: Added savedata analyzer --- src/godot_variant.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/godot_variant.h (limited to 'src/godot_variant.h') diff --git a/src/godot_variant.h b/src/godot_variant.h new file mode 100644 index 0000000..620e569 --- /dev/null +++ b/src/godot_variant.h @@ -0,0 +1,28 @@ +#ifndef GODOT_VARIANT_H_ED7F2EB6 +#define GODOT_VARIANT_H_ED7F2EB6 + +#include +#include +#include + +struct GodotVariant { + using value_type = std::variant, std::vector>; + + value_type value; + + GodotVariant(value_type v) : value(v) {} + + bool AsBool() const { return std::get(value); } + + const std::vector& AsNodePath() const { + return std::get>(value); + } + + const std::vector& AsArray() const { + return std::get>(value); + } +}; + +GodotVariant ParseGodotFile(std::string filename); + +#endif /* end of include guard: GODOT_VARIANT_H_ED7F2EB6 */ -- cgit 1.4.1