Offer runnable C++ and Lua project starters
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace faset::editor {
|
||||
@@ -38,6 +39,9 @@ class BuildService {
|
||||
BuildService(const BuildService&) = delete;
|
||||
BuildService& operator=(const BuildService&) = delete;
|
||||
void scaffold(const std::string& name, int dimension);
|
||||
// Explicit starter choice creates a runnable start scene. The legacy overload above
|
||||
// remains intentionally scene-free for existing command-line and API callers.
|
||||
void scaffold(const std::string& name, int dimension, std::string_view language);
|
||||
std::string start_build();
|
||||
std::string start_cook(Json resolved_scene);
|
||||
// Publishes output/generations/<id>; current.json changes only after all validation succeeds.
|
||||
|
||||
@@ -8,6 +8,7 @@ struct ProjectSelection {
|
||||
std::string name;
|
||||
int dimension = 3;
|
||||
bool create = false;
|
||||
std::string language = "cpp";
|
||||
};
|
||||
// Records only existing, valid projects. Call after successful Session setup.
|
||||
void remember_project(const std::filesystem::path& project);
|
||||
@@ -15,7 +16,9 @@ class ProjectLauncher {
|
||||
public:
|
||||
ProjectLauncher(render::Renderer&, const std::filesystem::path& engine_root,
|
||||
const std::filesystem::path& initial_project = {},
|
||||
const std::filesystem::path& recent_store = {});
|
||||
const std::filesystem::path& recent_store = {},
|
||||
const std::optional<ProjectSelection>& retry = {},
|
||||
std::string creation_error = {});
|
||||
~ProjectLauncher();
|
||||
void frame(const std::vector<render::Event>&);
|
||||
const render::Snapshot& snapshot() const;
|
||||
@@ -30,5 +33,7 @@ class ProjectLauncher {
|
||||
std::optional<ProjectSelection>
|
||||
run_project_launcher(const std::filesystem::path& engine_root,
|
||||
const std::filesystem::path& initial_project = {},
|
||||
std::uint64_t max_frames = 0, const std::filesystem::path& capture = {});
|
||||
std::uint64_t max_frames = 0, const std::filesystem::path& capture = {},
|
||||
const std::optional<ProjectSelection>& retry = {},
|
||||
std::string creation_error = {});
|
||||
} // namespace faset::editor
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <faset/editor/plugins.hpp>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
|
||||
namespace faset::editor {
|
||||
@@ -33,6 +34,7 @@ class Session {
|
||||
return plugins_ ? plugins_->panels() : Json::array();
|
||||
}
|
||||
void scaffold(const std::string& name, int dimension);
|
||||
void scaffold(const std::string& name, int dimension, std::string_view language);
|
||||
const SessionConfig& config() const {
|
||||
return config_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user