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

#pragma once

#include "commands.hpp"

namespace nostalgia::gfx {

class FlipXCommand: public TileSheetCommand {
	private:
		TileSheet &m_img;
		TileSheet::SubSheetIdx m_subSheetIdx;
		ox::Point const m_ptA;
		ox::Point const m_ptB;

	public:
		FlipXCommand(
				TileSheet &img,
				TileSheet::SubSheetIdx subSheetIdx,
				ox::Point const &a,
				ox::Point const &b) 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;

};

class FlipYCommand: public TileSheetCommand {
	private:
		TileSheet &m_img;
		TileSheet::SubSheetIdx m_subSheetIdx;
		ox::Point const m_ptA;
		ox::Point const m_ptB;

	public:
		FlipYCommand(
				TileSheet &img,
				TileSheet::SubSheetIdx subSheetIdx,
				ox::Point const &a,
				ox::Point const &b) 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;

};

}
