#pragma once #include #include #include #include #include #include #include #include namespace faset::editor { struct SessionConfig { std::filesystem::path project_root, engine_root, binary_directory; }; class Session { public: explicit Session(SessionConfig); ~Session(); Session(const Session&) = delete; Session& operator=(const Session&) = delete; authoring::AuthoringService& authoring() { return authoring_; } Commands& commands() { return commands_; } void poll(); const std::vector& logs() const { return logs_; } Json project() const; Json plugin_panels() const { return plugins_ ? plugins_->panels() : Json::array(); } void scaffold(const std::string& name, int dimension); const SessionConfig& config() const { return config_; } bool playing() const { return bool(player_); } void log(std::string message); private: struct ImportTask; void register_commands(); Json assets_list() const; Json jobs() const; Json job(const std::string& id) const; void load_schema(const std::filesystem::path& path); void launch_player(Json scene, const std::filesystem::path& executable); void stop_player(); SessionConfig config_; authoring::AuthoringService authoring_; Commands commands_; assets::AssetPipeline assets_; BuildService builds_; std::map> imports_; std::vector workers_; std::vector logs_; std::map observed_jobs_; std::unique_ptr player_; std::filesystem::path control_path_; std::uint64_t control_sequence_ = 0; std::string pending_play_job_; Json pending_play_scene_; std::unique_ptr plugins_; }; } // namespace faset::editor