The Battle for Wesnoth  1.15.12+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  /**
27  * The unit can move but can't attack, and wouldn't be able to attack even
28  * if it was moved to a hex adjacent to an enemy.
29  */
30  disengaged,
31  /** All moves and possible attacks have been done. */
32  moved,
33  /** There are still moves and/or attacks possible, but the unit doesn't fit in the "unmoved" status. */
34  partial,
35  /** Belongs to a friendly side */
36  allied,
37  /** Belongs to a non-friendly side; normally visualised by not displaying an orb. */
38  enemy
39 };
40 
42 {
43 /**
44  * Wrapper for the various preferences::show_..._orb() methods, using the
45  * enum instead of exposing a separate function for each preference.
46  */
47 bool prefs_show_orb(orb_status os);
48 
49 /**
50  * Wrapper for the various preferences::unmoved_color(), moved_color(), etc
51  * methods, using the enum instead of exposing a separate function for each
52  * preference.
53  */
54 std::string get_orb_color(orb_status os);
55 } // 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:39
All moves and possible attacks have been done.
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
There are still moves and/or attacks possible, but the unit doesn&#39;t fit in the "unmoved" status...