The Battle for Wesnoth  1.15.9+dev
orb_status.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020 by Steve Cotton <steve@octalot.co.uk>
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 #include "units/orb_status.hpp"
16 #include "preferences/game.hpp"
17 
19 {
20  switch(os) {
23  case orb_status::moved:
27  case orb_status::allied:
29  case orb_status::enemy:
31  default:
32  assert(!"expected to handle all the enum values");
33  return false;
34  }
35 }
36 
38 {
39  switch(os) {
42  case orb_status::moved:
43  return preferences::moved_color();
46  case orb_status::allied:
48  case orb_status::enemy:
49  return preferences::enemy_color();
50  default:
51  assert(!"expected to handle all the enum values");
52  return {};
53  }
54 }
std::string unmoved_color()
Definition: general.cpp:341
bool show_enemy_orb()
Definition: general.cpp:261
bool show_allied_orb()
Definition: general.cpp:254
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:23
The unit still has full movement and all attacks available.
Belongs to a non-friendly side; normally visualised by not displaying an orb.
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:37
bool show_moved_orb()
Definition: general.cpp:268
std::string allied_color()
Definition: general.cpp:301
std::string moved_color()
Definition: general.cpp:331
All moves and possible attacks have been done.
std::string partial_color()
Definition: general.cpp:351
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:18
bool show_unmoved_orb()
Definition: general.cpp:275
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:282
std::string enemy_color()
Definition: general.cpp:321