/*
 * 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 ChangeTileSheet: public studio::UndoCommand {
	private:
		keel::Context &m_kctx;
		WorldObjectSet &m_doc;
		ox::FileAddress m_valAlt;
		ox::String &m_selectedTilesheet;
	public:
		ChangeTileSheet(
				keel::Context &kctx,
				WorldObjectSet &doc,
				ox::FileAddress newVal,
				ox::String &path) noexcept;
		ox::Error redo() noexcept override;
		ox::Error undo() noexcept override;
		[[nodiscard]]
		int commandId() const noexcept override;

	private:
		ox::Error swap() noexcept;
};

}
