summaryrefslogtreecommitdiff
path: root/include/s
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2024-09-12 22:36:34 +0200
committerGitHub <noreply@github.com>2024-09-12 16:36:34 -0400
commit1180e1f4860d62bccd64bfa2a29eaeebd2c4b019 (patch)
treece6e231ef46aacbdad52ad7f6cbcd9d02dba555e /include/s
parente2c4bb7be7fa731a335bce4bc22283d899133e39 (diff)
m3d (#13)
* Initial M3d Pass * `m_bmdl` and `m_bline` left --------- Co-authored-by: elijah-thomas774 <elijahthomas774@gmail.com> Co-authored-by: Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com>
Diffstat (limited to 'include/s')
-rw-r--r--include/s/README.txt6
-rw-r--r--include/s/s_StateID.hpp4
-rw-r--r--include/s/s_StateInterfaces.hpp4
-rw-r--r--include/s/s_StateMgr.hpp5
4 files changed, 15 insertions, 4 deletions
diff --git a/include/s/README.txt b/include/s/README.txt
index 00e8279e..53c6cb63 100644
--- a/include/s/README.txt
+++ b/include/s/README.txt
@@ -16,3 +16,9 @@ In order for vtable ordering to match, some classes had to be extracted to a new
S_StateMethod_c's destructors calls back into another destructors. sStateMethodIf_c follows the example of
the other abstract interface classes and provides this dtor.
+
+## operator== / != return BOOL instead of bool
+
+We're observing a lot of word-to-bool casts in code after these
+operators are invoked, and while there are ways to force the conversion,
+this seems the most reasonable.
diff --git a/include/s/s_StateID.hpp b/include/s/s_StateID.hpp
index 422d9143..4c2ee84f 100644
--- a/include/s/s_StateID.hpp
+++ b/include/s/s_StateID.hpp
@@ -27,8 +27,8 @@ public:
virtual bool isNull() const;
virtual bool isEqual(const sStateIDIf_c &other) const;
- virtual bool operator==(const sStateIDIf_c &other) const;
- virtual bool operator!=(const sStateIDIf_c &other) const;
+ virtual BOOL operator==(const sStateIDIf_c &other) const;
+ virtual BOOL operator!=(const sStateIDIf_c &other) const;
virtual bool isSameName(const char *name) const;
virtual const char *name() const;
diff --git a/include/s/s_StateInterfaces.hpp b/include/s/s_StateInterfaces.hpp
index 8e28f44c..92101b2c 100644
--- a/include/s/s_StateInterfaces.hpp
+++ b/include/s/s_StateInterfaces.hpp
@@ -23,8 +23,8 @@ public:
virtual bool isNull() const = 0; ///< Returns whether this is a null state.
virtual bool isEqual(const sStateIDIf_c &other) const = 0; ///< Returns whether both states have the same number.
- virtual bool operator==(const sStateIDIf_c &other) const = 0; ///< Overloaded equality operator, using ::isEqual.
- virtual bool operator!=(const sStateIDIf_c &other) const = 0; ///< Overloaded inequality operator, using ::isEqual.
+ virtual BOOL operator==(const sStateIDIf_c &other) const = 0; ///< Overloaded equality operator, using ::isEqual.
+ virtual BOOL operator!=(const sStateIDIf_c &other) const = 0; ///< Overloaded inequality operator, using ::isEqual.
virtual bool isSameName(const char *name) const = 0; ///< Returns whether this state ID is called @p name.
virtual const char *name() const = 0; ///< Returns the name of this state ID.
diff --git a/include/s/s_StateMgr.hpp b/include/s/s_StateMgr.hpp
index c043eb71..09f5f217 100644
--- a/include/s/s_StateMgr.hpp
+++ b/include/s/s_StateMgr.hpp
@@ -35,6 +35,11 @@ public:
virtual const sStateIDIf_c *getStateID() const { return mMethod.getStateID(); }
virtual const sStateIDIf_c *getOldStateID() const { return mMethod.getOldStateID(); }
+ // SS addition
+ bool isState(const sStateIDIf_c& other) {
+ return *getStateID() == other;
+ }
+
private:
Check mCheck;
Factory<T> mFactory;