The Battle for Wesnoth  1.15.9+dev
orb_status.hpp
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 #pragma once
16 
17 #include <memory>
18 #include <string>
19 
20 /**
21  * Corresponds to the colored orbs displayed above units' hp-bar and xp-bar.
22  */
23 enum class orb_status {
24  /** The unit still has full movement and all attacks available. */
25  unmoved,
26  /** All moves and possible attacks have been done. */
27  moved,
28  /** There are still moves and/or attacks possible, but the unit doesn't fit in the "unmoved" status. */
29  partial,
30  /** Belongs to a friendly side */
31  allied,
32  /** Belongs to a non-friendly side; normally visualised by not displaying an orb. */
33  enemy
34 };
35 
37 {
38 /**
39  * Wrapper for the various preferences::show_..._orb() methods, using the
40  * enum instead of exposing a separate function for each preference.
41  */
42 bool prefs_show_orb(orb_status os);
43 
44 /**
45  * Wrapper for the various preferences::unmoved_color(), moved_color(), etc
46  * methods, using the enum instead of exposing a separate function for each
47  * preference.
48  */
49 std::string get_orb_color(orb_status os);
50 } // namespace orb_status_helper
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
All moves and possible attacks have been done.
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
There are still moves and/or attacks possible, but the unit doesn&#39;t fit in the "unmoved" status...