1// Aseprite
2// Copyright (C) 2019 Igara Studio S.A.
3//
4// This program is distributed under the terms of
5// the End-User License Agreement for Aseprite.
6
7#ifndef APP_CMD_REMAP_TILESET_H_INCLUDED
8#define APP_CMD_REMAP_TILESET_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_tileset.h"
13#include "doc/remap.h"
14
15namespace app {
16namespace cmd {
17 using namespace doc;
18
19 class RemapTileset : public Cmd
20 , public WithTileset {
21 public:
22 RemapTileset(Tileset* tileset,
23 const Remap& remap);
24
25 protected:
26 void onExecute() override;
27 void onUndo() override;
28 size_t onMemSize() const override {
29 return sizeof(*this) + m_remap.getMemSize();
30 }
31
32 private:
33 void applyRemap(Tileset* tileset, const Remap& remap);
34
35 Remap m_remap;
36 };
37
38} // namespace cmd
39} // namespace app
40
41#endif
42