The brush class represents a single brush – a set of relative locations around a "hotspot", and related info such as the icon image. More...
#include <brush.hpp>
Public Member Functions | |
brush () | |
Construct a default (empty) brush. More... | |
brush (const config &cfg) | |
Construct a brush object from config. More... | |
void | add_relative_location (int relative_x, int relative_y) |
Add a location to the brush. More... | |
std::set< map_location > | project (const map_location &hotspot) const |
Get a set of locations affected (i.e. More... | |
const std::string | name () const |
const std::string | id () const |
Protected Attributes | |
std::set< map_location > | relative_tiles_ |
The relative locations of the brush. More... | |
std::string | name_ |
std::string | id_ |
The brush class represents a single brush – a set of relative locations around a "hotspot", and related info such as the icon image.
It is constructed from WML – the [brush] tag.
editor::brush::brush | ( | ) |
|
explicit |
Construct a brush object from config.
Definition at line 32 of file brush.cpp.
References add_relative_location(), config::child_range(), get_tiles_in_radius(), loc, name_, relative_tiles_, WRN_ED, map_location::x, and map_location::y.
void editor::brush::add_relative_location | ( | int | relative_x, |
int | relative_y | ||
) |
Add a location to the brush.
If it already exists nothing will change.
Definition at line 56 of file brush.cpp.
References relative_tiles_.
Referenced by brush().
|
inline |
Definition at line 58 of file brush.hpp.
References id_.
Referenced by editor::editor_toolkit::is_active_brush().
|
inline |
std::set< map_location > editor::brush::project | ( | const map_location & | hotspot | ) | const |
Get a set of locations affected (i.e.
under the brush) when the center (hotspot) is in given location
Definition at line 61 of file brush.cpp.
References relative_tiles_.
Referenced by editor::brush_drag_mouse_action::affected_hexes().
|
protected |
|
protected |
|
protected |
The relative locations of the brush.
Definition at line 64 of file brush.hpp.
Referenced by add_relative_location(), brush(), and project().