/*
 * 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 MovePageCommand: public studio::UndoCommand {
	private:
		Palette &m_pal;
		std::size_t const m_srcIdx = 0;
		std::size_t const m_dstIdx = 0;

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

		~MovePageCommand() noexcept override = default;

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

		ox::Error redo() noexcept override;

		ox::Error undo() noexcept override;

	private:
		void movePage(size_t srcIdx, size_t dstIdx) noexcept;
};

}
