1#ifndef GAME_EDITOR_MAPITEMS_LAYER_GROUP_H
2#define GAME_EDITOR_MAPITEMS_LAYER_GROUP_H
3
4#include "layer.h"
5
6#include <memory>
7#include <vector>
8
9class CLayerGroup
10{
11public:
12 class CEditorMap *m_pMap;
13
14 std::vector<std::shared_ptr<CLayer>> m_vpLayers;
15
16 int m_OffsetX;
17 int m_OffsetY;
18
19 int m_ParallaxX;
20 int m_ParallaxY;
21
22 int m_UseClipping;
23 int m_ClipX;
24 int m_ClipY;
25 int m_ClipW;
26 int m_ClipH;
27
28 char m_aName[12];
29 bool m_GameGroup;
30 bool m_Visible;
31 bool m_Collapse;
32
33 CLayerGroup();
34 ~CLayerGroup();
35
36 void Convert(CUIRect *pRect) const;
37 void Render();
38 void MapScreen() const;
39 void Mapping(float *pPoints) const;
40
41 void GetSize(float *pWidth, float *pHeight) const;
42
43 void DeleteLayer(int Index);
44 void DuplicateLayer(int Index);
45 int SwapLayers(int Index0, int Index1);
46
47 bool IsEmpty() const
48 {
49 return m_vpLayers.empty();
50 }
51
52 void Clear()
53 {
54 m_vpLayers.clear();
55 }
56
57 void AddLayer(const std::shared_ptr<CLayer> &pLayer);
58
59 void ModifyImageIndex(FIndexModifyFunction Func)
60 {
61 for(auto &pLayer : m_vpLayers)
62 pLayer->ModifyImageIndex(pfnFunc: Func);
63 }
64
65 void ModifyEnvelopeIndex(FIndexModifyFunction Func)
66 {
67 for(auto &pLayer : m_vpLayers)
68 pLayer->ModifyEnvelopeIndex(pfnFunc: Func);
69 }
70
71 void ModifySoundIndex(FIndexModifyFunction Func)
72 {
73 for(auto &pLayer : m_vpLayers)
74 pLayer->ModifySoundIndex(pfnFunc: Func);
75 }
76};
77
78#endif
79