#ifndef TOOLS_UTIL_TSCN_H_ #define TOOLS_UTIL_TSCN_H_ #include #include #include #include #include #include namespace com::fourisland::lingo2_archipelago { struct GodotExtResource { std::string type; std::string path; }; struct GodotExtResourceRef { std::string id; }; using GodotInstanceType = std::variant; class GodotNode { public: GodotNode(std::string name, GodotInstanceType instance_type) : name_(std::move(name)), instance_type_(std::move(instance_type)) {} const std::string& GetName() const { return name_; } const GodotInstanceType& GetInstanceType() const { return instance_type_; } const GodotNode* GetParent() const { return parent_; } GodotNode* GetParent() { return parent_; } std::string GetPath() const; void AddChild(GodotNode& child); const GodotNode* GetNode(absl::string_view path) const; GodotNode* GetNode(absl::string_view path); const std::map GetChildren() const { return children_; } private: std::string name_; GodotInstanceType instance_type_; GodotNode* parent_ = nullptr; std::map children_; }; class GodotScene { public: virtual const GodotExtResource* GetExtResource( const std::string& id) const = 0; virtual const GodotNode& GetRoot() const = 0; }; std::unique_ptr ReadGodotSceneFromFile(const std::string& path); } // namespace com::fourisland::lingo2_archipelago #endif /* TOOLS_UTIL_TSCN_H_ */