The Battle for Wesnoth  1.15.12+dev
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020 by Steve Cotton <>
3  Part of the Battle for Wesnoth Project
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,
12  See the COPYING file for more details.
13 */
15 #include "units/orb_status.hpp"
16 #include "preferences/game.hpp"
19 {
20  switch(os) {
23  case orb_status::moved:
29  case orb_status::allied:
31  case orb_status::enemy:
33  default:
34  assert(!"expected to handle all the enum values");
35  return false;
36  }
37 }
40 {
41  switch(os) {
44  case orb_status::moved:
45  return preferences::moved_color();
50  case orb_status::allied:
52  case orb_status::enemy:
53  return preferences::enemy_color();
54  default:
55  assert(!"expected to handle all the enum values");
56  return {};
57  }
58 }
std::string unmoved_color()
Definition: general.cpp:347
bool show_enemy_orb()
Definition: general.cpp:261
bool show_allied_orb()
Definition: general.cpp:254
Belongs to a friendly side.
Corresponds to the colored orbs displayed above units&#39; hp-bar and xp-bar.
Definition: orb_status.hpp:23
std::string disengaged_color()
Definition: general.cpp:367
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:289
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:39
bool show_moved_orb()
Definition: general.cpp:268
std::string allied_color()
Definition: general.cpp:307
std::string moved_color()
Definition: general.cpp:337
All moves and possible attacks have been done.
std::string partial_color()
Definition: general.cpp:357
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: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:327