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. | |
| brush (const config &cfg) | |
| Construct a brush object from config. | |
| void | add_relative_location (int relative_x, int relative_y) |
| Add a location to the brush. | |
| std::set< map_location > | project (const map_location &hotspot) const |
| Get a set of locations affected (i.e. | |
| const std::string | name () const |
| const std::string | image () const |
Protected Attributes | |
| std::set< map_location > | relative_tiles_ |
| The relative locations of the brush. | |
| std::string | name_ |
| std::string | image_ |
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.
Definition at line 27 of file brush.hpp.
| editor::brush::brush | ( | ) |
| editor::brush::brush | ( | const config & | cfg | ) | [explicit] |
Construct a brush object from config.
Definition at line 68 of file brush.cpp.
References add_relative_location(), config::child_range(), get_tiles_in_radius(), 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 92 of file brush.cpp.
References relative_tiles_.
Referenced by brush().

| const std::string editor::brush::image | ( | ) | const [inline] |
| const std::string editor::brush::name | ( | ) | const [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 97 of file brush.cpp.
References relative_tiles_, and map_location::vector_sum().

std::string editor::brush::image_ [protected] |
std::string editor::brush::name_ [protected] |
std::set<map_location> editor::brush::relative_tiles_ [protected] |
The relative locations of the brush.
Definition at line 65 of file brush.hpp.
Referenced by add_relative_location(), brush(), and project().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:20:04 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |