DDraceNetwork Docs
layer_switch.h
Go to the documentation of this file.
1#ifndef GAME_EDITOR_MAPITEMS_LAYER_SWITCH_H
2#define GAME_EDITOR_MAPITEMS_LAYER_SWITCH_H
3
4#include "layer_tiles.h"
5
7{
9 struct SData
10 {
12 int m_Type;
17};
18
20{
21public:
22 CLayerSwitch(CEditor *pEditor, int w, int h);
23 CLayerSwitch(const CLayerSwitch &Other);
25
27 unsigned char m_SwitchNumber;
28 unsigned char m_SwitchDelay;
29
30 void Resize(int NewW, int NewH) override;
31 void Shift(int Direction) override;
32 bool IsEmpty(const std::shared_ptr<CLayerTiles> &pLayer) override;
33 void BrushDraw(std::shared_ptr<CLayer> pBrush, vec2 WorldPos) override;
34 void BrushFlipX() override;
35 void BrushFlipY() override;
36 void BrushRotate(float Amount) override;
37 void FillSelection(bool Empty, std::shared_ptr<CLayer> pBrush, CUIRect Rect) override;
38 virtual bool ContainsElementWithId(int Id);
39 virtual void GetPos(int Number, int Offset, ivec2 &SwitchPos);
40
43
45 inline void ClearHistory() override
46 {
48 m_History.clear();
49 }
50
51 std::shared_ptr<CLayer> Duplicate() const override;
52 const char *TypeName() const override;
53
54private:
56};
57
58#endif
Definition: editor.h:276
Definition: layer_switch.h:20
~CLayerSwitch()
Definition: layer_switch.cpp:27
void BrushFlipX() override
Definition: layer_switch.cpp:174
unsigned char m_SwitchDelay
Definition: layer_switch.h:28
virtual void GetPos(int Number, int Offset, ivec2 &SwitchPos)
Definition: layer_switch.cpp:333
bool IsEmpty(const std::shared_ptr< CLayerTiles > &pLayer) override
Definition: layer_switch.cpp:60
ivec2 m_GotoSwitchLastPos
Definition: layer_switch.h:42
EditorTileStateChangeHistory< SSwitchTileStateChange > m_History
Definition: layer_switch.h:44
void ClearHistory() override
Definition: layer_switch.h:45
virtual bool ContainsElementWithId(int Id)
Definition: layer_switch.cpp:317
void Shift(int Direction) override
Definition: layer_switch.cpp:54
CSwitchTile * m_pSwitchTile
Definition: layer_switch.h:26
const char * TypeName() const override
Definition: layer_switch.cpp:390
void RecordStateChange(int x, int y, SSwitchTileStateChange::SData Previous, SSwitchTileStateChange::SData Current)
Definition: layer_switch.cpp:166
std::shared_ptr< CLayer > Duplicate() const override
Definition: layer_switch.cpp:385
void Resize(int NewW, int NewH) override
Definition: layer_switch.cpp:32
void BrushRotate(float Amount) override
Definition: layer_switch.cpp:186
int m_GotoSwitchOffset
Definition: layer_switch.h:41
unsigned char m_SwitchNumber
Definition: layer_switch.h:27
void BrushFlipY() override
Definition: layer_switch.cpp:180
void FillSelection(bool Empty, std::shared_ptr< CLayer > pBrush, CUIRect Rect) override
Definition: layer_switch.cpp:226
void BrushDraw(std::shared_ptr< CLayer > pBrush, vec2 WorldPos) override
Definition: layer_switch.cpp:70
CLayerSwitch(CEditor *pEditor, int w, int h)
Definition: layer_switch.cpp:5
Definition: layer_tiles.h:35
virtual void ClearHistory()
Definition: layer_tiles.h:189
Definition: mapitems.h:548
Definition: ui_rect.h:11
std::map< int, std::map< int, T > > EditorTileStateChangeHistory
Definition: layer_tiles.h:18
Definition: layer_switch.h:10
int m_Index
Definition: layer_switch.h:15
int m_Flags
Definition: layer_switch.h:13
int m_Type
Definition: layer_switch.h:12
int m_Number
Definition: layer_switch.h:11
int m_Delay
Definition: layer_switch.h:14
Definition: layer_switch.h:7
struct SSwitchTileStateChange::SData m_Current
struct SSwitchTileStateChange::SData m_Previous
bool m_Changed
Definition: layer_switch.h:8