Etterna 0.74.4
Loading...
Searching...
No Matches
RadarValues.h
1#ifndef RARAR_VALUES_H
2#define RARAR_VALUES_H
3
4#include "GameConstantsAndTypes.h"
5#include "ThemeMetric.h"
6
8#define RADAR_VAL_UNKNOWN (-1)
9
10class XNode;
11struct lua_State;
14{
15 private:
16 int m_Values[NUM_RadarCategory];
17
18 public:
19 auto operator[](RadarCategory cat) const -> int { return m_Values[cat]; }
20 auto operator[](RadarCategory cat) -> int& { return m_Values[cat]; }
21 auto operator[](int cat) const -> int { return m_Values[cat]; }
22 auto operator[](int cat) -> int& { return m_Values[cat]; }
23
25 void MakeUnknown();
26 void Zero();
27
33 auto operator+=(const RadarValues& other) -> RadarValues&
34 {
35 FOREACH_ENUM(RadarCategory, rc) { (*this)[rc] += other[rc]; }
36 return *this;
37 }
43 auto operator==(const RadarValues& other) const -> bool
44 {
45 FOREACH_ENUM(RadarCategory, rc)
46 {
47 if ((*this)[rc] != other[rc]) {
48 return false;
49 }
50 }
51 return true;
52 }
58 auto operator!=(const RadarValues& other) const -> bool
59 {
60 return !operator==(other);
61 }
62
63 [[nodiscard]] auto CreateNode() const -> XNode*;
64 void LoadFromNode(const XNode* pNode);
65
66 [[nodiscard]] auto ToString(int iMaxValues = -1) const
67 -> std::string; // default = all
68 void FromString(const std::string& sValues);
69
70 static ThemeMetric<bool> WRITE_SIMPLE_VALIES;
71 static ThemeMetric<bool> WRITE_COMPLEX_VALIES;
72
73 // Lua
74 void PushSelf(lua_State* L);
75};
76
77#endif
The theme specific data.
Definition ThemeMetric.h:52
Definition XmlFile.h:95
Cached song statistics.
Definition RadarValues.h:14
auto operator+=(const RadarValues &other) -> RadarValues &
Add one set of radar values to another.
Definition RadarValues.h:33
auto operator!=(const RadarValues &other) const -> bool
Determine if one set of radar values are not equal to another.
Definition RadarValues.h:58
auto operator==(const RadarValues &other) const -> bool
Determine if one set of radar values are equal to another.
Definition RadarValues.h:43