Public Member Functions | Private Member Functions | Private Attributes

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 t_string &, const std::string &, const map_location &, const map_labels &, const SDL_Color color=font::NORMAL_COLOR, const bool visible_in_fog=true, const bool visible_in_shroud=false, const bool immutable=false)
 creating new label
 terrain_label (const map_labels &, const config &)
 Load label from config.
 ~terrain_label ()
void write (config &res) const
void read (const config &cfg)
const t_stringtext () const
const std::string & team_name () const
bool visible_in_fog () const
bool visible_in_shroud () const
bool immutable () const
const map_locationlocation () const
const SDL_Color & color () const
void set_text (const t_string &)
void update_info (const t_string &, const std::string &, const SDL_Color)
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
std::string cfg_color () const

Private Attributes

int handle_
t_string text_
std::string team_name_
bool visible_in_fog_
bool visible_in_shroud_
bool immutable_
SDL_Color color_
const map_labelsparent_
map_location loc_

Detailed Description

To store label data Class implements logic for rendering.

Definition at line 84 of file map_label.hpp.


Constructor & Destructor Documentation

terrain_label::terrain_label ( const t_string text,
const std::string &  team_name,
const map_location loc,
const map_labels parent,
const SDL_Color  color = font::NORMAL_COLOR,
const bool  visible_in_fog = true,
const bool  visible_in_shroud = false,
const bool  immutable = false 
)

creating new label

Definition at line 283 of file map_label.cpp.

References draw().

Here is the call graph for this function:

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

Load label from config.

Definition at line 305 of file map_label.cpp.

References read().

Here is the call graph for this function:

terrain_label::~terrain_label (  ) 

Definition at line 320 of file map_label.cpp.

References clear().

Here is the call graph for this function:

terrain_label::terrain_label ( const terrain_label  )  [private]

Member Function Documentation

void terrain_label::calculate_shroud (  )  const

Definition at line 432 of file map_label.cpp.

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

Referenced by draw().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 398 of file map_label.cpp.

References color_.

Referenced by write().

Here is the caller graph for this function:

void terrain_label::clear (  )  [private]

Definition at line 488 of file map_label.cpp.

References handle_, and font::remove_floating_label().

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

Here is the call graph for this function:

Here is the caller graph for this function:

const SDL_Color & terrain_label::color (  )  const

Definition at line 393 of file map_label.cpp.

References color_.

Referenced by do_replay_handle(), editor::mouse_action_map_label::drag_left(), and read().

Here is the caller graph for this function:

void terrain_label::draw (  )  [private]
bool terrain_label::immutable (  )  const

Definition at line 383 of file map_label.cpp.

References immutable_.

Referenced by playsingle_controller::can_execute_command(), editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

Here is the caller graph for this function:

const map_location & terrain_label::location (  )  const

Definition at line 388 of file map_label.cpp.

References loc_.

Referenced by do_replay_handle().

Here is the caller graph for this function:

const terrain_label& terrain_label::operator= ( const terrain_label  )  [private]
void terrain_label::read ( const config cfg  ) 

Definition at line 325 of file map_label.cpp.

References color(), color_, immutable_, int_to_color(), utils::interpolate_variables_into_string(), utils::interpolate_variables_into_tstring(), font::LABEL_COLOR, loc_, resources::state_of_game, string2rgb(), team_name_, text_, visible_in_fog_, and visible_in_shroud_.

Referenced by terrain_label().

Here is the call graph for this function:

Here is the caller graph for this function:

void terrain_label::recalculate (  ) 

Definition at line 427 of file map_label.cpp.

References draw().

Referenced by map_labels::set_label().

Here is the call graph for this function:

Here is the caller graph for this function:

void terrain_label::set_text ( const t_string text  ) 

Definition at line 412 of file map_label.cpp.

References text_.

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

Definition at line 417 of file map_label.cpp.

References color_, draw(), team_name_, and text_.

Here is the call graph for this function:

bool terrain_label::visible (  )  const [private]

Definition at line 477 of file map_label.cpp.

References map_labels::disp(), display::fogged(), is_observer(), loc_, team::nteams(), parent_, display::shrouded(), map_labels::team_name(), team_name_, map_labels::visible_global_label(), visible_in_fog_, and visible_in_shroud_.

Referenced by draw().

Here is the call graph for this function:

Here is the caller graph for this function:

bool terrain_label::visible_in_fog (  )  const

Definition at line 373 of file map_label.cpp.

References visible_in_fog_.

Referenced by editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

Here is the caller graph for this function:

bool terrain_label::visible_in_shroud (  )  const

Definition at line 378 of file map_label.cpp.

References visible_in_shroud_.

Referenced by editor::mouse_action_map_label::drag_left(), and editor::mouse_action_map_label::up_left().

Here is the caller graph for this function:

void terrain_label::write ( config res  )  const

Definition at line 352 of file map_label.cpp.

References cfg_color(), immutable_, loc_, team_name(), text(), visible_in_fog_, visible_in_shroud_, and map_location::write().

Referenced by replay::add_label().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

SDL_Color terrain_label::color_ [private]

Definition at line 136 of file map_label.hpp.

Referenced by cfg_color(), color(), draw(), read(), and update_info().

int terrain_label::handle_ [private]

Definition at line 128 of file map_label.hpp.

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

bool terrain_label::immutable_ [private]

Definition at line 134 of file map_label.hpp.

Referenced by immutable(), read(), and write().

Definition at line 139 of file map_label.hpp.

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

Definition at line 138 of file map_label.hpp.

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

std::string terrain_label::team_name_ [private]

Definition at line 131 of file map_label.hpp.

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

Definition at line 130 of file map_label.hpp.

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

Definition at line 132 of file map_label.hpp.

Referenced by read(), visible(), visible_in_fog(), and write().

Definition at line 133 of file map_label.hpp.

Referenced by calculate_shroud(), read(), visible(), visible_in_shroud(), and write().


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:16:34 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs