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

#pragma once

#include "commands.hpp"

namespace nostalgia::gfx {

class DeleteTilesCommand: public TileSheetCommand {
	private:
		TileSheet &m_img;
		TileSheet::SubSheetIdx const m_idx;
		std::size_t const m_deletePos = 0;
		std::size_t const m_deleteSz = 0;
		ox::Vector<uint8_t> const m_deletedPixels;

	public:
		DeleteTilesCommand(
				TileSheet &img,
				TileSheet::SubSheetIdx idx,
				std::size_t tileIdx,
				std::size_t tileCnt) 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;

};

}