Public Member Functions | Protected Attributes

editor::brush Class Reference

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>

Collaboration diagram for editor::brush:
Collaboration graph
[legend]

List of all members.

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_locationproject (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_locationrelative_tiles_
 The relative locations of the brush.
std::string name_
std::string image_

Detailed Description

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.


Constructor & Destructor Documentation

editor::brush::brush (  ) 

Construct a default (empty) brush.

Note that not even the hotspot is affected by default,

Definition at line 61 of file brush.cpp.

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.

Here is the call graph for this function:


Member Function Documentation

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().

Here is the caller graph for this function:

const std::string editor::brush::image (  )  const [inline]
Returns:
the image of this brush

Definition at line 59 of file brush.hpp.

References image_.

const std::string editor::brush::name (  )  const [inline]
Returns:
the name of this brush

Definition at line 54 of file brush.hpp.

References name_.

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().

Here is the call graph for this function:


Member Data Documentation

std::string editor::brush::image_ [protected]

Definition at line 68 of file brush.hpp.

Referenced by image().

std::string editor::brush::name_ [protected]

Definition at line 67 of file brush.hpp.

Referenced by brush(), and name().

The relative locations of the brush.

Definition at line 65 of file brush.hpp.

Referenced by add_relative_location(), brush(), and project().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:20:04 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs