| 1 | // Aseprite Document Library |
| 2 | // Copyright (c) 2019-2020 Igara Studio S.A. |
| 3 | // |
| 4 | // This file is released under the terms of the MIT license. |
| 5 | // Read LICENSE.txt for more information. |
| 6 | |
| 7 | #ifndef DOC_LAYER_TILEMAP_H_INCLUDED |
| 8 | #define DOC_LAYER_TILEMAP_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "doc/layer.h" |
| 12 | #include "doc/tile.h" |
| 13 | #include "doc/tileset.h" |
| 14 | |
| 15 | namespace doc { |
| 16 | |
| 17 | class LayerTilemap : public LayerImage { |
| 18 | public: |
| 19 | explicit LayerTilemap(Sprite* sprite, const tileset_index tsi); |
| 20 | ~LayerTilemap(); |
| 21 | |
| 22 | Grid grid() const override; |
| 23 | |
| 24 | // Returns the tileset of this layer. New automatically-created |
| 25 | // tiles should be stored into this tileset, and all tiles in the |
| 26 | // layer should share the same Grid spec. |
| 27 | Tileset* tileset() const { return m_tileset; } |
| 28 | tileset_index tilesetIndex() const { return m_tilesetIndex; } |
| 29 | |
| 30 | void setTilesetIndex(tileset_index tsi); |
| 31 | |
| 32 | private: |
| 33 | Tileset* m_tileset; |
| 34 | tileset_index m_tilesetIndex; |
| 35 | }; |
| 36 | |
| 37 | } // namespace doc |
| 38 | |
| 39 | #endif |
| 40 | |