NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
s_StateID.hpp
1#pragma once
2#include <game/sLib/s_StateInterfaces.hpp>
3
7class sStateID_c : public sStateIDIf_c {
8public:
10 public:
11 NumberMemo_c() : curr(0) {}
12 unsigned int get() {
13 curr++;
14 return curr;
15 }
16 unsigned int curr;
17 };
18
19 sStateID_c(const char *name);
20 virtual ~sStateID_c();
21
22 virtual bool isNull() const;
23 virtual bool isEqual(const sStateIDIf_c &other) const;
24
25 virtual bool operator==(const sStateIDIf_c &other) const;
26 virtual bool operator!=(const sStateIDIf_c &other) const;
27
28 virtual bool isSameName(const char *name) const;
29 virtual const char *name() const;
30 virtual unsigned int number() const;
31
32protected:
33 const char *mpName;
34 unsigned int mNumber;
35
37};
38
39namespace sStateID {
40
42 extern sStateID_c null;
43}
The interface for state IDs.
A generic implementation of a state ID.
Definition s_StateID.hpp:7
virtual bool isSameName(const char *name) const
Returns whether this state ID is called name.
Definition s_StateID.cpp:30
unsigned int mNumber
The number of this state ID.
Definition s_StateID.hpp:34
const char * mpName
The name of this state ID.
Definition s_StateID.hpp:33
static NumberMemo_c sm_numberMemo
Used to give each state a unique number.
Definition s_StateID.hpp:36
virtual const char * name() const
Returns the name of this state ID.
Definition s_StateID.cpp:35
virtual bool isNull() const
Returns whether this is a null state.
Definition s_StateID.cpp:14
virtual bool isEqual(const sStateIDIf_c &other) const
Returns whether both states have the same number.
Definition s_StateID.cpp:18
virtual bool operator==(const sStateIDIf_c &other) const
Overloaded equality operator, using isEqual.
Definition s_StateID.cpp:22
virtual unsigned int number() const
Returns the number of this state ID.
Definition s_StateID.cpp:39
virtual bool operator!=(const sStateIDIf_c &other) const
Overloaded inequality operator, using isEqual.
Definition s_StateID.cpp:26
sStateID_c null