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

#pragma once

#include "commands.hpp"

namespace nostalgia::gfx {

class RotateCommand: public TileSheetCommand {
	public:
		enum class Direction {
			Right,
			Left,
		};

	private:
		TileSheet &m_img;
		TileSheet::SubSheetIdx m_idx;
		ox::Point const m_pt1;
		ox::Point const m_pt2;
		Direction const m_dir;

	public:
		RotateCommand(TileSheet &img, TileSheet::SubSheetIdx idx, Direction dir) noexcept;

		RotateCommand(
			TileSheet &img,
			TileSheet::SubSheetIdx idx,
			ox::Point const &pt1,
			ox::Point const &pt2,
			Direction dir) 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;

};

}
