#pragma once

#include <filesystem>
#include <vector>

#include "core/project_model.hpp"

namespace smartcut::core {

class ProjectEditor {
 public:
  explicit ProjectEditor(Project project = {}) : project_(std::move(project)) {}
  const Project& project() const { return project_; }
  void add_segment(KeptSegment segment);
  bool undo();
  bool redo();
  bool save_atomic(const std::filesystem::path& path) const;
 private:
  Project project_;
  std::vector<Project> undo_stack_;
  std::vector<Project> redo_stack_;
};

}  // namespace smartcut::core
