The Battle for Wesnoth  1.19.4+dev
unit_recall.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2024
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #define GETTEXT_DOMAIN "wesnoth-lib"
16 
18 
19 #include "font/text_formatting.hpp"
21 #include "gui/dialogs/message.hpp"
22 #include "gui/widgets/listbox.hpp"
23 #include "gui/widgets/button.hpp"
24 #include "gui/widgets/image.hpp"
25 #include "gui/widgets/label.hpp"
26 #include "gui/widgets/text_box.hpp"
28 #include "gui/widgets/window.hpp"
29 #include "help/help.hpp"
30 #include "game_board.hpp"
31 #include "gettext.hpp"
32 #include "replay_helper.hpp"
33 #include "play_controller.hpp"
34 #include "resources.hpp"
35 #include "synced_context.hpp"
36 #include "team.hpp"
37 #include "units/unit.hpp"
38 #include "units/ptr.hpp"
39 #include "units/types.hpp"
40 #include <functional>
41 #include "whiteboard/manager.hpp"
42 
43 
44 static lg::log_domain log_display("display");
45 #define LOG_DP LOG_STREAM(info, log_display)
46 
47 namespace gui2::dialogs
48 {
49 
50 // Index 2 is by-level
51 static listbox::order_pair sort_last {-1, sort_order::type::none};
52 static listbox::order_pair sort_default { 2, sort_order::type::descending};
53 
55 
56 unit_recall::unit_recall(std::vector<unit_const_ptr>& recall_list, team& team)
57  : modal_dialog(window_id())
58  , recall_list_(recall_list)
59  , team_(team)
60  , selected_index_()
61  , filter_options_()
62  , last_words_()
63 {
64 }
65 
66 template<typename T>
67 static void dump_recall_list_to_console(const T& units)
68 {
69  log_scope2(log_display, "dump_recall_list_to_console()")
70 
71  LOG_DP << "size: " << units.size();
72 
73  std::size_t idx = 0;
74  for(const auto& u_ptr : units) {
75  LOG_DP << "\tunit[" << (idx++) << "]: " << u_ptr->id() << " name = '" << u_ptr->name() << "'";
76  }
77 }
78 
79 static const color_t inactive_row_color(0x96, 0x96, 0x96);
80 
81 static const inline std::string maybe_inactive(const std::string& str, bool active)
82 {
83  if(active)
84  return str;
85  else
87 }
88 
89 static std::string format_level_string(const int level, bool recallable)
90 {
91  std::string lvl = std::to_string(level);
92 
93  if(!recallable) {
94  // Same logic as when recallable, but always in inactive_row_color.
95  if(level < 2) {
97  } else {
98  return font::span_color(inactive_row_color, "<b>" + lvl + "</b>");
99  }
100  } else if(level < 1) {
102  } else if(level == 1) {
103  return lvl;
104  } else if(level == 2) {
105  return "<b>" + lvl + "</b>";
106  } else {
107  return"<b><span color='#ffffff'>" + lvl + "</span></b>";
108  }
109 }
110 
111 static std::string format_cost_string(int unit_recall_cost, const int team_recall_cost)
112 {
113  std::stringstream str;
114 
115  if(unit_recall_cost < 0) {
116  unit_recall_cost = team_recall_cost;
117  }
118 
119  if(unit_recall_cost > team_recall_cost) {
120  str << "<span color='#ff0000'>" << unit_recall_cost << "</span>";
121  } else if(unit_recall_cost == team_recall_cost) {
122  str << unit_recall_cost;
123  } else if(unit_recall_cost < team_recall_cost) {
124  str << "<span color='#00ff00'>" << unit_recall_cost << "</span>";
125  }
126 
127  return str.str();
128 }
129 
130 static std::string get_title_suffix(int side_num)
131 {
132  if(!resources::gameboard) {
133  return "";
134  }
135 
136  unit_map& units = resources::gameboard->units();
137 
138  int controlled_recruiters = 0;
139  for(const auto& team : resources::gameboard->teams()) {
140  if(team.is_local_human() && !team.recruits().empty() && units.find_leader(team.side()) !=units.end()) {
141  ++controlled_recruiters;
142  }
143  }
144 
145  std::stringstream msg;
146  if(controlled_recruiters >= 2) {
148  if(leader != resources::gameboard->units().end() && !leader->name().empty()) {
149  msg << " (" << leader->name(); msg << ")";
150  }
151  }
152 
153  return msg.str();
154 }
155 
157 {
158  label& title = find_widget<label>("title", true);
159  title.set_label(title.get_label() + get_title_suffix(team_.side()));
160 
161  text_box* filter
162  = find_widget<text_box>("filter_box", false, true);
163 
165  std::bind(&unit_recall::filter_text_changed, this, std::placeholders::_2));
166 
167  listbox& list = find_widget<listbox>("recall_list");
168 
170 
171  list.clear();
172 
173  keyboard_capture(filter);
174  add_to_keyboard_chain(&list);
175 
177  find_widget<button>("rename"),
178  std::bind(&unit_recall::rename_unit, this));
179 
181  find_widget<button>("dismiss"),
182  std::bind(&unit_recall::dismiss_unit, this));
183 
185  find_widget<button>("show_help"),
186  std::bind(&unit_recall::show_help, this));
187 
188  for(const unit_const_ptr& unit : recall_list_) {
189  widget_data row_data;
190  widget_item column;
191 
192  std::string mods = unit->image_mods();
193 
194  int wb_gold = 0;
196  if(const std::shared_ptr<wb::manager>& whiteb = resources::controller->get_whiteboard()) {
197  wb::future_map future; // So gold takes into account planned spending
198  wb_gold = whiteb->get_spent_gold_for(team_.side());
199  }
200  }
201 
202  // Note: Our callers apply [filter_recall], but leave it to us
203  // to apply cost-based filtering.
204  const int recall_cost = (unit->recall_cost() > -1 ? unit->recall_cost() : team_.recall_cost());
205  const bool recallable = (recall_cost <= team_.gold() - wb_gold);
206 
207  if(unit->can_recruit()) {
208  mods += "~BLIT(" + unit::leader_crown() + ")";
209  }
210 
211  for(const std::string& overlay : unit->overlays()) {
212  mods += "~BLIT(" + overlay + ")";
213  }
214 
215  if(!recallable) {
216  mods += "~GS()";
217 
218  // Just set the tooltip on every single element in this row.
219  if(wb_gold > 0)
220  column["tooltip"] = _("This unit cannot be recalled because you will not have enough gold at this point in your plan.");
221  else
222  column["tooltip"] = _("This unit cannot be recalled because you do not have enough gold.");
223  }
224 
225  column["use_markup"] = "true";
226 
227  column["label"] = unit->absolute_image() + mods;
228  row_data.emplace("unit_image", column);
229 
230  column["label"] = maybe_inactive(unit->type_name(), recallable);
231  row_data.emplace("unit_type", column);
232 
233  // gold_icon is handled below
234 
235  column["label"] =
236  recallable
238  : maybe_inactive(std::to_string(recall_cost), recallable);
239  row_data.emplace("unit_recall_cost", column);
240 
241  const std::string& name = !unit->name().empty() ? unit->name().str() : font::unicode_en_dash;
242  column["label"] = maybe_inactive(name, recallable);
243  row_data.emplace("unit_name", column);
244 
245  column["label"] = format_level_string(unit->level(), recallable);
246  row_data.emplace("unit_level", column);
247 
248  std::stringstream exp_str;
249  if(unit->can_advance()) {
250  exp_str << unit->experience() << "/" << unit->max_experience();
251  } else {
252  exp_str << font::unicode_en_dash;
253  }
254 
255  column["label"] = font::span_color(recallable ? unit->xp_color() : inactive_row_color, exp_str.str());
256  row_data.emplace("unit_experience", column);
257 
258  // Since the table widgets use heavy formatting, we save a bare copy
259  // of certain options to filter on.
260  std::string filter_text = unit->type_name() + " " + name + " " + std::to_string(unit->level())
262  if(const auto* race = unit->race()) {
263  filter_text += " " + race->name(unit->gender()) + " " + race->plural_name();
264  }
265 
266  if(recallable) {
267  // This is to allow filtering for recallable units by typing "vvv" in the search box.
268  // That's intended to be easy to type and unlikely to match unit or type names.
269  //
270  // TODO: document this. (Also, implement a "Hide non-recallable units" checkbox.)
271  filter_text += " " + std::string("vvv");
272  }
273 
274  std::string traits;
275  for(const std::string& trait : unit->trait_names()) {
276  traits += (traits.empty() ? "" : "\n") + trait;
277  filter_text += " " + trait;
278  }
279 
280  column["label"] = maybe_inactive(
281  !traits.empty() ? traits : font::unicode_en_dash,
282  recallable);
283  row_data.emplace("unit_traits", column);
284 
285  filter_options_.push_back(filter_text);
286  grid& grid = list.add_row(row_data);
287  if(!recallable) {
288  image *gold_icon = dynamic_cast<image*>(grid.find("gold_icon", false));
289  assert(gold_icon);
290  gold_icon->set_image(gold_icon->get_image() + "~GS()");
291  }
292  }
293 
294  list.register_translatable_sorting_option(0, [this](const int i) { return recall_list_[i]->type_name().str(); });
295  list.register_translatable_sorting_option(1, [this](const int i) { return recall_list_[i]->name().str(); });
296  list.register_sorting_option(2, [this](const int i) {
297  const unit& u = *recall_list_[i];
298  return std::tuple(u.level(), -static_cast<int>(u.experience_to_advance()));
299  });
300  list.register_sorting_option(3, [this](const int i) { return recall_list_[i]->experience(); });
301  list.register_translatable_sorting_option(4, [this](const int i) {
302  return !recall_list_[i]->trait_names().empty() ? recall_list_[i]->trait_names().front().str() : "";
303  });
304 
305  list.set_active_sorting_option(sort_last.first >= 0 ? sort_last : sort_default, true);
306 
308 }
309 
311 {
312  listbox& list = find_widget<listbox>("recall_list");
313 
314  const int index = list.get_selected_row();
315  if (index == -1) {
316  return;
317  }
318 
319  unit& selected_unit = const_cast<unit&>(*recall_list_[index].get());
320 
321  std::string name = selected_unit.name();
322  const std::string dialog_title(_("Rename Unit"));
323  const std::string dialog_label(_("Name:"));
324 
325  if(gui2::dialogs::edit_text::execute(dialog_title, dialog_label, name)) {
326  selected_unit.rename(name);
327 
328  list.get_row_grid(index)->find_widget<label>("unit_name").set_label(name);
329 
330  filter_options_.erase(filter_options_.begin() + index);
331  std::ostringstream filter_text;
332  filter_text << selected_unit.type_name() << " " << name << " " << std::to_string(selected_unit.level());
333  for(const std::string& trait : selected_unit.trait_names()) {
334  filter_text << " " << trait;
335  }
336  filter_options_.insert(filter_options_.begin() + index, filter_text.str());
337 
340  }
341 }
342 
344 {
345  LOG_DP << "Recall list units:"; dump_recall_list_to_console(recall_list_);
346 
347  listbox& list = find_widget<listbox>("recall_list");
348  const int index = list.get_selected_row();
349  if (index == -1) {
350  return;
351  }
352 
353  const unit& u = *recall_list_[index].get();
354 
355  // If the unit is of level > 1, or is close to advancing, we warn the player about it
356  std::stringstream message;
357  if(u.loyal()) {
358  message << _("This unit is loyal and requires no upkeep.") << " " << (u.gender() == unit_race::MALE
359  ? _("Do you really want to dismiss him?")
360  : _("Do you really want to dismiss her?"));
361 
362  } else if(u.level() > 1) {
363  message << _("This unit is an experienced one, having advanced levels.") << " " << (u.gender() == unit_race::MALE
364  ? _("Do you really want to dismiss him?")
365  : _("Do you really want to dismiss her?"));
366 
367  } else if(u.experience() > u.max_experience()/2) {
368  message << _("This unit is close to advancing a level.") << " " << (u.gender() == unit_race::MALE
369  ? _("Do you really want to dismiss him?")
370  : _("Do you really want to dismiss her?"));
371  }
372 
373  if(!message.str().empty()) {
374  const int res = gui2::show_message(_("Dismiss Unit"), message.str(), message::yes_no_buttons);
375 
376  if(res != gui2::retval::OK) {
377  return;
378  }
379  }
380 
381  recall_list_.erase(recall_list_.begin() + index);
382 
383  // Remove the entry from the dialog list
384  list.remove_row(index);
386 
387  // Remove the entry from the filter list
388  filter_options_.erase(filter_options_.begin() + index);
389  assert(filter_options_.size() == list.get_item_count());
390 
391  LOG_DP << "Dismissing a unit, side = " << u.side() << ", id = '" << u.id() << "'";
392  LOG_DP << "That side's recall list:";
394 
395  // Find the unit in the recall list.
396  unit_ptr dismissed_unit = team_.recall_list().find_if_matches_id(u.id());
397  assert(dismissed_unit);
398 
399  // Record the dismissal, then delete the unit.
400  synced_context::run_and_throw("disband", replay_helper::get_disband(dismissed_unit->id()));
401 
402  // Close the dialog if all units are dismissed
403  if(list.get_item_count() == 0) {
405  }
406 }
407 
409 {
410  help::show_help("recruit_and_recall");
411 }
412 
414 {
415  const int selected_row
416  = find_widget<listbox>("recall_list").get_selected_row();
417 
418  if(selected_row == -1) {
419  return;
420  }
421 
422  const unit& selected_unit = *recall_list_[selected_row].get();
423 
424  find_widget<unit_preview_pane>("unit_details")
425  .set_displayed_unit(selected_unit);
426 
427  find_widget<button>("rename").set_active(!selected_unit.unrenamable());
428 }
429 
431 {
432  listbox& list = find_widget<listbox>("recall_list");
434 
435  if(get_retval() == retval::OK) {
437  }
438 }
439 
440 void unit_recall::filter_text_changed(const std::string& text)
441 {
442  listbox& list = find_widget<listbox>("recall_list");
443 
444  const std::vector<std::string> words = utils::split(text, ' ');
445 
446  if(words == last_words_)
447  return;
448  last_words_ = words;
449 
450  boost::dynamic_bitset<> show_items;
451  show_items.resize(list.get_item_count(), true);
452 
453  if(!text.empty()) {
454  for(unsigned int i = 0; i < list.get_item_count(); i++) {
455  bool found = false;
456 
457  for(const auto & word : words) {
458  found = translation::ci_search(filter_options_[i], word);
459 
460  if(!found) {
461  // one word doesn't match, we don't reach words.end()
462  break;
463  }
464  }
465 
466  show_items[i] = found;
467  }
468  }
469 
470  list.set_row_shown(show_items);
471 
472  // Disable rename and dismiss buttons if no units are shown
473  const bool any_shown = list.any_rows_shown();
474  find_widget<button>("rename").set_active(any_shown);
475  find_widget<button>("dismiss").set_active(any_shown);
476 }
477 
478 } // namespace dialogs
virtual const unit_map & units() const override
Definition: game_board.hpp:107
Main class to show messages to the user.
Definition: message.hpp:36
@ yes_no_buttons
Shows a yes and no button.
Definition: message.hpp:81
Abstract base class for all modal dialogs.
int get_retval() const
Returns the cached window exit code.
std::vector< std::string > filter_options_
Definition: unit_recall.hpp:49
virtual void pre_show() override
Actions to be taken before showing the window.
void list_item_clicked()
Callbacks.
void filter_text_changed(const std::string &text)
std::vector< unit_const_ptr > & recall_list_
Definition: unit_recall.hpp:43
virtual void post_show() override
Actions to be taken after the window has been shown.
std::vector< std::string > last_words_
Definition: unit_recall.hpp:50
Base container class.
Definition: grid.hpp:32
widget * find(const std::string &id, const bool must_be_active) override
See widget::find.
Definition: grid.cpp:645
t_string get_image() const
Wrapper for label.
Definition: image.hpp:58
void set_image(const t_string &label)
Wrapper for set_label.
Definition: image.hpp:45
The listbox class.
Definition: listbox.hpp:43
void set_row_shown(const unsigned row, const bool shown)
Makes a row visible or invisible.
Definition: listbox.cpp:135
void set_active_sorting_option(const order_pair &sort_by, const bool select_first=false)
Sorts the listbox by a pre-set sorting option.
Definition: listbox.cpp:620
std::pair< int, sort_order::type > order_pair
Definition: listbox.hpp:273
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
Definition: listbox.cpp:58
const grid * get_row_grid(const unsigned row) const
Returns the grid of the wanted row.
Definition: listbox.cpp:229
void register_translatable_sorting_option(const int col, translatable_sorter_func_t f)
Registers a special sorting function specifically for translatable values.
Definition: listbox.cpp:612
bool any_rows_shown() const
Definition: listbox.cpp:218
void register_sorting_option(const int col, const Func &f)
Definition: listbox.hpp:260
void remove_row(const unsigned row, unsigned count=1)
Removes a row in the listbox.
Definition: listbox.cpp:78
void clear()
Removes all the rows in the listbox, clearing it.
Definition: listbox.cpp:117
int get_selected_row() const
Returns the first selected row.
Definition: listbox.cpp:267
unsigned get_item_count() const
Returns the number of items in the listbox.
Definition: listbox.cpp:123
const order_pair get_active_sorting_option()
Definition: listbox.cpp:639
const t_string & get_label() const
virtual void set_label(const t_string &text)
void set_text_changed_callback(std::function< void(text_box_base *textbox, const std::string text)> cb)
Set the text_changed callback.
A widget that allows the user to input text in single line.
Definition: text_box.hpp:125
NOT_DANGLING T * find_widget(const std::string &id, const bool must_be_active, const bool must_exist)
Gets a widget with the wanted id.
Definition: widget.hpp:737
window * get_window()
Get the parent window.
Definition: widget.cpp:117
void set_retval(const int retval, const bool close_window=true)
Sets there return value of the window.
Definition: window.hpp:397
void keyboard_capture(widget *widget)
Definition: window.cpp:1219
void invalidate_layout()
Updates the size of the window.
Definition: window.cpp:773
void add_to_keyboard_chain(widget *widget)
Adds the widget to the keyboard chain.
Definition: window.cpp:1225
unit_ptr find_if_matches_id(const std::string &unit_id)
Find a unit by id.
static config get_disband(const std::string &unit_id)
static bool run_and_throw(const std::string &commandname, const config &data, bool use_undo=true, bool show=true, synced_command::error_handler_function error_handler=default_error_function)
bool empty() const
Definition: tstring.hpp:186
const std::string & str() const
Definition: tstring.hpp:190
This class stores all the data for a single 'side' (in game nomenclature).
Definition: team.hpp:74
int side() const
Definition: team.hpp:174
int recall_cost() const
Definition: team.hpp:179
bool is_local_human() const
Definition: team.hpp:253
int gold() const
Definition: team.hpp:175
recall_list_manager & recall_list()
Definition: team.hpp:201
const std::set< std::string > & recruits() const
Definition: team.hpp:209
Container associating units to locations.
Definition: map.hpp:98
unit_iterator end()
Definition: map.hpp:428
unit_iterator find_leader(int side)
Definition: map.cpp:320
@ MALE
Definition: race.hpp:28
static std::string alignment_description(unit_alignments::type align, unit_race::GENDER gender=unit_race::MALE)
Implementation detail of unit_type::alignment_description.
Definition: types.cpp:839
This class represents a single unit of a specific type.
Definition: unit.hpp:133
static const std::string & leader_crown()
The path to the leader crown overlay.
Definition: unit.cpp:1134
std::size_t i
Definition: function.cpp:1023
static std::string _(const char *str)
Definition: gettext.hpp:93
unit_alignments::type alignment() const
The alignment of this unit.
Definition: unit.hpp:475
int level() const
The current level of this unit.
Definition: unit.hpp:559
const t_string & type_name() const
Gets the translatable name of this unit's type.
Definition: unit.hpp:369
bool unrenamable() const
Whether this unit can be renamed.
Definition: unit.hpp:436
int recall_cost() const
How much gold it costs to recall this unit, or -1 if the side's default recall cost is used.
Definition: unit.hpp:640
void rename(const std::string &name)
Attempts to rename this unit's translatable display name, taking the 'unrenamable' flag into account.
Definition: unit.hpp:424
const unit_race * race() const
Gets this unit's race.
Definition: unit.hpp:493
int experience() const
The current number of experience points this unit has.
Definition: unit.hpp:523
bool can_recruit() const
Whether this unit can recruit other units - ie, are they a leader unit.
Definition: unit.hpp:612
const std::string & id() const
Gets this unit's id.
Definition: unit.hpp:380
int side() const
The side this unit belongs to.
Definition: unit.hpp:343
unsigned int experience_to_advance() const
The number of experience points this unit needs to level up, or 0 if current XP > max XP.
Definition: unit.hpp:541
int max_experience() const
The max number of experience points this unit can have.
Definition: unit.hpp:529
unit_race::GENDER gender() const
The gender of this unit.
Definition: unit.hpp:465
const t_string & name() const
Gets this unit's translatable display name.
Definition: unit.hpp:403
bool can_advance() const
Checks whether this unit has any options to advance to.
Definition: unit.hpp:272
color_t xp_color() const
Color for this unit's XP.
Definition: unit.cpp:1209
std::string image_mods() const
Gets an IPF string containing all IPF image mods.
Definition: unit.cpp:2731
const std::vector< std::string > & overlays() const
Get the unit's overlay images.
Definition: unit.hpp:1677
std::string absolute_image() const
The name of the file to game_display (used in menus).
Definition: unit.cpp:2550
const std::vector< t_string > & trait_names() const
Gets the names of the currently registered traits.
Definition: unit.hpp:1098
bool loyal() const
Gets whether this unit is loyal - ie, it costs no upkeep.
Definition: unit.cpp:1694
This file contains the window object, this object is a top level container which has the event manage...
#define log_scope2(domain, description)
Definition: log.hpp:279
const std::string unicode_en_dash
Definition: constants.cpp:43
std::string span_color(const color_t &color)
Returns a Pango formatting string using the provided color_t object.
static std::string get_title_suffix(int side_num)
static listbox::order_pair sort_default
Definition: unit_recall.cpp:52
static const std::string maybe_inactive(const std::string &str, bool active)
Definition: unit_recall.cpp:81
static std::string format_level_string(const int level)
Definition: unit_list.cpp:47
static void dump_recall_list_to_console(const T &units)
Definition: unit_recall.cpp:67
static const color_t inactive_row_color(0x96, 0x96, 0x96)
static listbox::order_pair sort_last
Definition: unit_recall.cpp:51
REGISTER_DIALOG(editor_edit_unit)
static std::string format_cost_string(int unit_recall_cost, const int team_recall_cost)
void connect_signal_notify_modified(dispatcher &dispatcher, const signal_notification &signal)
Connects a signal handler for getting a notification upon modification.
Definition: dispatcher.cpp:203
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
Definition: dispatcher.cpp:177
std::map< std::string, widget_item > widget_data
Definition: widget.hpp:36
std::map< std::string, t_string > widget_item
Definition: widget.hpp:33
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
Definition: message.cpp:148
@ OK
Dialog was closed with the OK button.
Definition: retval.hpp:35
@ CANCEL
Dialog was closed with the CANCEL button.
Definition: retval.hpp:38
void show_help(const std::string &show_topic)
Open the help browser, show topic with id show_topic.
Definition: help.cpp:140
Functions to load and save images from/to disk.
game_board * gameboard
Definition: resources.cpp:20
play_controller * controller
Definition: resources.cpp:21
bool ci_search(const std::string &s1, const std::string &s2)
Definition: gettext.cpp:565
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
Definition: unicode.cpp:70
std::vector< std::string > split(const config_attribute_value &val)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Definition: debugger.cpp:109
std::shared_ptr< const unit > unit_const_ptr
Definition: ptr.hpp:27
std::shared_ptr< unit > unit_ptr
Definition: ptr.hpp:26
The basic class for representing 8-bit RGB or RGBA colour values.
Definition: color.hpp:59
Applies the planned unit map for the duration of the struct's life.
Definition: manager.hpp:253
#define LOG_DP
Definition: unit_recall.cpp:45
static lg::log_domain log_display("display")