map_labels Class Reference

#include <map_label.hpp>

Collaboration diagram for map_labels:

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map
< gamemap::location, const
terrain_label * > 
label_map
typedef std::map< std::string,
label_map
team_label_map

Public Member Functions

 map_labels (const display &disp, const gamemap &map, const team *)
 map_labels (const display &disp, const config &cfg, const gamemap &map, const team *, const variable_set *variables)
 ~map_labels ()
void write (config &res) const
void read (const config &cfg, const variable_set *variables)
const terrain_labelget_label (const gamemap::location &loc, const std::string &team_name)
const terrain_labelget_label (const gamemap::location &loc)
const terrain_labelset_label (const gamemap::location &loc, const std::string &text, const std::string team="", const SDL_Color colour=font::NORMAL_COLOUR)
void add_label (const gamemap::location &, const terrain_label *)
void clear (const std::string &)
void scroll (double xmove, double ymove)
void recalculate_labels ()
bool visible_global_label (const gamemap::location &) const
void recalculate_shroud ()
const displaydisp () const
const std::string & team_name () const
void set_team (const team *)

Static Public Member Functions

static size_t get_max_chars ()

Private Member Functions

void clear_map (const label_map &)
void clear_all ()
 map_labels (const map_labels &)
void operator= (const map_labels &)

Private Attributes

const displaydisp_
const teamteam_
const gamemapmap_
team_label_map labels_
label_map label_cache_


Detailed Description

Definition at line 33 of file map_label.hpp.


Member Typedef Documentation

Definition at line 36 of file map_label.hpp.

Definition at line 37 of file map_label.hpp.


Constructor & Destructor Documentation

map_labels::map_labels ( const display disp,
const gamemap map,
const team team 
)

Definition at line 38 of file map_label.cpp.

map_labels::map_labels ( const display disp,
const config cfg,
const gamemap map,
const team team,
const variable_set variables 
)

Definition at line 47 of file map_label.cpp.

References read().

map_labels::~map_labels (  ) 

Definition at line 59 of file map_label.cpp.

References clear_all().

map_labels::map_labels ( const map_labels  )  [private]


Member Function Documentation

void map_labels::write ( config res  )  const

Definition at line 64 of file map_label.cpp.

References config::add_child(), and labels_.

Referenced by events::menu_handler::write_game_snapshot().

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

size_t map_labels::get_max_chars (  )  [static]

const terrain_label * map_labels::get_label ( const gamemap::location loc,
const std::string &  team_name 
)

const terrain_label * map_labels::get_label ( const gamemap::location loc  ) 

Definition at line 108 of file map_label.cpp.

References get_label(), and team_name().

const terrain_label * map_labels::set_label ( const gamemap::location loc,
const std::string &  text,
const std::string  team = "",
const SDL_Color  colour = font::NORMAL_COLOUR 
)

Definition at line 144 of file map_label.cpp.

References add_label(), preferences::erase(), and labels_.

Referenced by do_replay_handle(), and events::menu_handler::label_terrain().

void map_labels::add_label ( const gamemap::location loc,
const terrain_label new_label 
)

Definition at line 213 of file map_label.cpp.

References labels_, and terrain_label::team_name().

Referenced by read(), and set_label().

void map_labels::clear ( const std::string &  team_name  ) 

Definition at line 228 of file map_label.cpp.

References clear_map(), and labels_.

Referenced by events::menu_handler::clear_labels(), clear_map(), and do_replay_handle().

void map_labels::scroll ( double  xmove,
double  ymove 
)

Definition at line 261 of file map_label.cpp.

References labels_.

Referenced by display::scroll().

void map_labels::recalculate_labels (  ) 

Definition at line 272 of file map_label.cpp.

References labels_.

Referenced by read(), display::redraw_everything(), game_display::set_team(), and display::set_zoom().

bool map_labels::visible_global_label ( const gamemap::location loc  )  const

Definition at line 283 of file map_label.cpp.

References labels_, and team_name().

Referenced by terrain_label::visible().

void map_labels::recalculate_shroud (  ) 

Definition at line 290 of file map_label.cpp.

References labels_.

Referenced by clear_shroud().

const display & map_labels::disp (  )  const

Definition at line 120 of file map_label.cpp.

References disp_.

Referenced by terrain_label::calculate_shroud(), and terrain_label::draw().

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

void map_labels::set_team ( const team team  ) 

Definition at line 135 of file map_label.cpp.

References team_.

Referenced by game_display::set_team().

void map_labels::clear_map ( const label_map m  )  [private]

Definition at line 243 of file map_label.cpp.

References clear().

Referenced by clear(), and clear_all().

void map_labels::clear_all (  )  [private]

Definition at line 252 of file map_label.cpp.

References clear_map(), and labels_.

Referenced by read(), and ~map_labels().

void map_labels::operator= ( const map_labels  )  [private]


Member Data Documentation

const display& map_labels::disp_ [private]

Definition at line 80 of file map_label.hpp.

Referenced by disp().

const team* map_labels::team_ [private]

Definition at line 81 of file map_label.hpp.

Referenced by set_team(), and team_name().

const gamemap& map_labels::map_ [private]

Definition at line 82 of file map_label.hpp.

Definition at line 85 of file map_label.hpp.


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