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

#pragma once

#include <studio/undocommand.hpp>

#include <nostalgia/gfx/palette.hpp>

namespace nostalgia::gfx {

class DuplicatePageCommand: public studio::UndoCommand {
	private:
		Palette &m_pal;
		size_t m_dstIdx = 0;
		ox::Vector<PaletteColor> m_page;

	public:
		DuplicatePageCommand(Palette &pal, size_t srcIdx, size_t dstIdx) noexcept;

		~DuplicatePageCommand() noexcept override = default;

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

		ox::Error redo() noexcept final;

		ox::Error undo() noexcept final;

		[[nodiscard]]
		size_t insertIdx() const noexcept;

};

}