1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef RME_COPYBUFFER_H_
19#define RME_COPYBUFFER_H_
20
21#include <wx/dataobj.h>
22
23#include "position.h"
24#include "basemap.h"
25
26class Editor;
27
28class CopyBuffer {
29public:
30 CopyBuffer();
31 virtual ~CopyBuffer();
32
33 // In-editor implantation
34 void copy(Editor& editor, int floor);
35 void cut(Editor& editor, int floor);
36 void paste(Editor& editor, const Position& toPosition);
37 bool canPaste() const;
38 // Returns the upper-left corner of the copybuffer
39 Position getPosition() const;
40
41 // Clears the copybuffer (eg. resets it)
42 void clear();
43
44 size_t GetTileCount();
45
46 BaseMap& getBufferMap();
47
48private:
49 void collectModifiedPositions(const Position& toPosition, PositionVector& positions);
50 Position copyPos;
51 BaseMap* tiles;
52};
53
54#endif
55