/*
 * Copyright 2023 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
 */

#pragma once

#include <ox/fs/fs.hpp>

#include <studio/undostack.hpp>

#include <jasper/world/worldobject.hpp>

namespace jasper::world {

class AddObject: public studio::UndoCommand {
	private:
		WorldObjectSet &m_doc;
		size_t m_insertIdx{};
		WorldObject m_obj{};
	public:
		AddObject(WorldObjectSet &doc) noexcept;
		ox::Error redo() noexcept override;
		ox::Error undo() noexcept override;
		[[nodiscard]]
		int commandId() const noexcept override;
		[[nodiscard]]
		inline size_t insertIdx() const noexcept {
			return m_insertIdx;
		}
};

}
