terrain_label Class Reference

To store label data Class implements logic for rendering. More...

#include <map_label.hpp>

Collaboration diagram for terrain_label:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 terrain_label (const std::string &, const std::string &, const gamemap::location &, const map_labels &, const SDL_Color colour=font::NORMAL_COLOUR)
 creating new label
 terrain_label (const map_labels &, const config &, const variable_set *variables)
 Load label from config.
 terrain_label (const map_labels &)
 ~terrain_label ()
void write (config &res) const
void read (const config &cfg, const variable_set *variables)
const std::string & text () const
const std::string & team_name () const
const gamemap::locationlocation () const
const SDL_Colour & colour () const
void set_text (const std::string &)
void update_info (const std::string &, const std::string &, const SDL_Color)
void scroll (double xmove, double ymove) const
void recalculate ()
void calculate_shroud () const

Private Member Functions

 terrain_label (const terrain_label &)
const terrain_labeloperator= (const terrain_label &)
void clear ()
void draw ()
bool visible () const
void check_text_length ()
const std::string cfg_colour () const

Private Attributes

int handle_
std::string text_
std::string team_name_
SDL_Color colour_
const map_labelsparent_
gamemap::location loc_


Detailed Description

To store label data Class implements logic for rendering.

Definition at line 90 of file map_label.hpp.


Constructor & Destructor Documentation

terrain_label::terrain_label ( const std::string &  text,
const std::string &  team_name,
const gamemap::location loc,
const map_labels parent,
const SDL_Color  colour = font::NORMAL_COLOUR 
)

creating new label

Definition at line 303 of file map_label.cpp.

References check_text_length(), and draw().

terrain_label::terrain_label ( const map_labels parent,
const config cfg,
const variable_set variables 
)

Load label from config.

Definition at line 331 of file map_label.cpp.

References check_text_length(), and read().

terrain_label::terrain_label ( const map_labels parent  ) 

Definition at line 319 of file map_label.cpp.

terrain_label::~terrain_label (  ) 

Definition at line 342 of file map_label.cpp.

References clear().

terrain_label::terrain_label ( const terrain_label  )  [private]


Member Function Documentation

void terrain_label::write ( config res  )  const

Definition at line 380 of file map_label.cpp.

References cfg_colour(), loc_, team_name(), text(), and gamemap::location::write().

Referenced by replay::add_label().

void terrain_label::read ( const config cfg,
const variable_set variables 
)

const std::string & terrain_label::text (  )  const

Definition at line 389 of file map_label.cpp.

References text_.

Referenced by events::menu_handler::do_search(), events::menu_handler::label_terrain(), and write().

const std::string & terrain_label::team_name (  )  const

Definition at line 394 of file map_label.cpp.

References team_name_.

Referenced by map_labels::add_label(), events::menu_handler::label_terrain(), and write().

const gamemap::location & terrain_label::location (  )  const

Definition at line 399 of file map_label.cpp.

References loc_.

const SDL_Colour & terrain_label::colour (  )  const

Definition at line 404 of file map_label.cpp.

References colour_.

Referenced by read().

void terrain_label::set_text ( const std::string &  text  ) 

Definition at line 423 of file map_label.cpp.

References text_.

void terrain_label::update_info ( const std::string &  text,
const std::string &  team_name,
const   SDL_Color 
)

Definition at line 428 of file map_label.cpp.

References check_text_length(), colour_, draw(), team_name_, and text_.

void terrain_label::scroll ( double  xmove,
double  ymove 
) const

Definition at line 439 of file map_label.cpp.

References handle_, and font::move_floating_label().

void terrain_label::recalculate (  ) 

Definition at line 450 of file map_label.cpp.

References draw().

void terrain_label::calculate_shroud (  )  const

Definition at line 455 of file map_label.cpp.

References map_labels::disp(), handle_, is_shrouded(), loc_, parent_, and font::show_floating_label().

Referenced by draw().

const terrain_label& terrain_label::operator= ( const terrain_label  )  [private]

void terrain_label::clear ( void   )  [private]

Definition at line 506 of file map_label.cpp.

References handle_, and font::remove_floating_label().

Referenced by draw(), and ~terrain_label().

void terrain_label::draw (  )  [private]

bool terrain_label::visible (  )  const [private]

Definition at line 492 of file map_label.cpp.

References loc_, parent_, map_labels::team_name(), team_name_, and map_labels::visible_global_label().

Referenced by draw().

void terrain_label::check_text_length (  )  [private]

Definition at line 498 of file map_label.cpp.

References map_labels::get_max_chars(), parent_, text_, and utils::truncate_as_wstring().

Referenced by terrain_label(), and update_info().

const std::string terrain_label::cfg_colour (  )  const [private]

Definition at line 409 of file map_label.cpp.

References buf, and colour_.

Referenced by draw(), and write().


Member Data Documentation

int terrain_label::handle_ [private]

Definition at line 135 of file map_label.hpp.

Referenced by calculate_shroud(), clear(), draw(), and scroll().

std::string terrain_label::text_ [private]

Definition at line 137 of file map_label.hpp.

Referenced by check_text_length(), draw(), read(), set_text(), text(), and update_info().

std::string terrain_label::team_name_ [private]

Definition at line 138 of file map_label.hpp.

Referenced by read(), team_name(), update_info(), and visible().

SDL_Color terrain_label::colour_ [private]

Definition at line 139 of file map_label.hpp.

Referenced by cfg_colour(), colour(), draw(), read(), and update_info().

Definition at line 141 of file map_label.hpp.

Referenced by calculate_shroud(), check_text_length(), draw(), and visible().

Definition at line 142 of file map_label.hpp.

Referenced by calculate_shroud(), draw(), location(), read(), visible(), and write().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs