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

#pragma once

#include "commands.hpp"

namespace nostalgia::gfx {

class PaletteChangeCommand: public TileSheetCommand {
	private:
		TileSheet &m_img;
		TileSheet::SubSheetIdx m_idx;
		ox::String m_oldPalette;
		ox::String m_newPalette;

	public:
		PaletteChangeCommand(
				TileSheet::SubSheetIdx idx,
				TileSheet &img,
				ox::StringViewCR newPalette) noexcept;

		ox::Error redo() noexcept final;

		ox::Error undo() noexcept final;

		[[nodiscard]]
		int commandId() const noexcept final;

		[[nodiscard]]
		TileSheet::SubSheetIdx const &subsheetIdx() const noexcept override;

};

}