The Battle for Wesnoth  1.17.0-dev
orb_status.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020 - 2021
3  by Steve Cotton <steve@octalot.co.uk>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #include "units/orb_status.hpp"
17 #include "preferences/game.hpp"
18 
20 {
21  switch(os) {
24  case orb_status::moved:
30  case orb_status::allied:
32  case orb_status::enemy:
34  default:
35  assert(!"expected to handle all the enum values");
36  return false;
37  }
38 }
39 
41 {
42  switch(os) {
45  case orb_status::moved:
46  return preferences::moved_color();
51  case orb_status::allied:
53  case orb_status::enemy:
54  return preferences::enemy_color();
55  default:
56  assert(!"expected to handle all the enum values");
57  return {};
58  }
59 }
std::string unmoved_color()
Definition: general.cpp:353
bool show_enemy_orb()
Definition: general.cpp:267
bool show_allied_orb()
Definition: general.cpp:260
Belongs to a friendly side.
orb_status
Corresponds to the colored orbs displayed above units&#39; hp-bar and xp-bar.
Definition: orb_status.hpp:24
std::string disengaged_color()
Definition: general.cpp:373
The unit still has full movement and all attacks available.
Belongs to a non-friendly side; normally visualised by not displaying an orb.
bool show_disengaged_orb()
Definition: general.cpp:295
std::string get_orb_color(orb_status os)
Wrapper for the various preferences::unmoved_color(), moved_color(), etc methods, using the enum inst...
Definition: orb_status.cpp:40
bool show_moved_orb()
Definition: general.cpp:274
std::string allied_color()
Definition: general.cpp:313
std::string moved_color()
Definition: general.cpp:343
All moves and possible attacks have been done.
std::string partial_color()
Definition: general.cpp:363
The unit can move but can&#39;t attack, and wouldn&#39;t be able to attack even if it was moved to a hex adja...
bool prefs_show_orb(orb_status os)
Wrapper for the various preferences::show_..._orb() methods, using the enum instead of exposing a sep...
Definition: orb_status.cpp:19
bool show_unmoved_orb()
Definition: general.cpp:281
There are still moves and/or attacks possible, but the unit doesn&#39;t fit in the "unmoved" status...
bool show_partial_orb()
Definition: general.cpp:288
std::string enemy_color()
Definition: general.cpp:333