house_brush.h

main 74 lines · 2.1 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
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_HOUSE_BRUSH_H
19#define RME_HOUSE_BRUSH_H
20
21#include "brush.h"
22
23//=============================================================================
24// HouseBrush, draw house tiles
25// This brush is created on demand and NOT loaded, as such, the load() method is empty
26// Should be deleted by the owning palette
27
28// Forward declaration
29class HouseBrush : public Brush {
30public:
31 HouseBrush();
32 virtual ~HouseBrush();
33
34 bool isHouse() const {
35 return true;
36 }
37 HouseBrush* asHouse() {
38 return static_cast<HouseBrush*>(this);
39 }
40
41 // Not used
42 virtual bool load(pugi::xml_node node, wxArrayString& warnings) {
43 return true;
44 }
45
46 // You can always draw house tiles!
47 virtual bool canDraw(BaseMap* map, const Position& position) const {
48 return true;
49 }
50 // Draw the shit!
51 virtual void draw(BaseMap* map, Tile* tile, void* parameter);
52 // Undraw the shit!
53 virtual void undraw(BaseMap* map, Tile* tile);
54
55 virtual bool canDrag() const {
56 return true;
57 }
58
59 void setHouse(House* house);
60
61 uint32_t getHouseID() const;
62 virtual int getLookID() const {
63 return 0;
64 } // We don't have a graphic
65 virtual std::string getName() const {
66 return "House Brush";
67 }
68
69protected:
70 House* draw_house;
71};
72
73#endif
74
Top