1// Aseprite Document Library
2// Copyright (c) 2019 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#ifdef HAVE_CONFIG_H
8#include "config.h"
9#endif
10
11#include "doc/tilesets.h"
12
13namespace doc {
14
15Tilesets::Tilesets()
16 : Object(ObjectType::Tilesets)
17{
18}
19
20Tilesets::~Tilesets()
21{
22 for (auto tileset : m_tilesets)
23 delete tileset;
24}
25
26int Tilesets::getMemSize() const
27{
28 int size = sizeof(Tilesets);
29 for (auto tileset : m_tilesets) {
30 if (tileset)
31 size += tileset->getMemSize();
32 }
33 return size;
34}
35
36tileset_index Tilesets::add(Tileset* tileset)
37{
38 m_tilesets.push_back(tileset);
39 return tileset_index(m_tilesets.size()-1);
40}
41
42} // namespace doc
43