/*
 * 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 RmPalette: public studio::UndoCommand {
	private:
		WorldObjectSet &m_doc;
		ox::FileAddress m_pal;
		size_t const m_rmIdx = 0;
		struct ObjUpdate {
			size_t idx{};
			uint8_t oldPalBank{};
			uint8_t newPalBank{};
		};
		ox::Vector<ObjUpdate> m_objUpdates;
	public:
		RmPalette(WorldObjectSet &doc, size_t rmIdx) noexcept;
		ox::Error redo() noexcept override;
		ox::Error undo() noexcept override;
		[[nodiscard]]
		int commandId() const noexcept override;
};

}
