23 #include <SDL2/SDL_rect.h>
35 typedef std::map<map_location, terrain_label>
label_map;
58 const int creator = -1,
59 const std::string&
team =
"",
61 const bool visible_in_fog =
true,
62 const bool visible_in_shroud =
false,
63 const bool immutable =
false,
64 const std::string& category =
"",
71 void enable(
bool is_enabled);
73 void clear(
const std::string&,
bool force);
88 template<
typename... T>
A config object defines a single node in a WML file, with access to child nodes.
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
void write(config &res) const
void clear_map(label_map &, bool)
const std::vector< std::string > & all_categories() const
const std::string & team_name() const
bool visible_global_label(const map_location &) const
Returns whether or not a global (non-team) label can be shown at a specified location.
terrain_label * add_label(T &&... args)
const terrain_label * set_label(const map_location &loc, const t_string &text, const int creator=-1, const std::string &team="", const color_t color=font::NORMAL_COLOR, const bool visible_in_fog=true, const bool visible_in_shroud=false, const bool immutable=false, const std::string &category="", const t_string &tooltip="")
const terrain_label * get_label(const map_location &loc, const std::string &team_name) const
void recalculate_shroud()
terrain_label * get_label_private(const map_location &loc, const std::string &team_name)
map_labels & operator=(const map_labels &)
void enable(bool is_enabled)
void set_team(const team *)
void clear(const std::string &, bool force)
std::vector< std::string > categories
map_labels(const map_labels &)
void recalculate_labels()
std::map< std::string, label_map > team_label_map
std::map< map_location, terrain_label > label_map
void read(const config &cfg)
This class stores all the data for a single 'side' (in game nomenclature).
To store label data Class implements logic for rendering.
terrain_label(const terrain_label &)=delete
Delete copy ctor and assignment ops.
bool visible_in_shroud() const
terrain_label & operator=(const terrain_label &)=delete
void update_info(const t_string &, const int creator, const t_string &, const std::string &, const color_t)
bool visible_in_fog() const
const t_string & tooltip() const
void set_text(const t_string &text)
void write(config &res) const
const map_labels * parent_
SDL_Rect get_rect() const
bool hidden() const
This is a lightweight test used to see if labels are revealed as a result of unit actions (i....
const color_t & color() const
bool viewable(const display &disp) const
This is a test used to see if we should bother with the overhead of actually creating a label.
const std::string & category() const
const t_string & text() const
const map_location & location() const
void read(const config &cfg)
const std::string & team_name() const
std::string tooltip
Shown when hovering over an entry in the filter's drop-down list.
const color_t NORMAL_COLOR
The basic class for representing 8-bit RGB or RGBA colour values.
Encapsulates the map of the game.