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