NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
s_StateInterfaces.hpp
1#pragma once
2
5
11public:
12 virtual ~sStateIDIf_c() {}
13
14 virtual bool isNull() const = 0;
15 virtual bool isEqual(const sStateIDIf_c &other) const = 0;
16
17 virtual bool operator==(const sStateIDIf_c &other) const = 0;
18 virtual bool operator!=(const sStateIDIf_c &other) const = 0;
19
20 virtual bool isSameName(const char *name) const = 0;
21 virtual const char *name() const = 0;
22 virtual unsigned int number() const = 0;
23};
24
28public:
29 virtual ~sStateIf_c() {}
30 virtual const void initialize() = 0;
31 virtual const void execute() = 0;
32 virtual const void finalize() = 0;
33};
34
38public:
39 virtual ~sStateFctIf_c() {}
40 virtual sStateIf_c *build(sStateIDIf_c const &id) = 0;
41 virtual void dispose(sStateIf_c *&id) = 0;
42};
43
47public:
48 virtual ~sStateIDChkIf_c() {}
49 virtual bool isNormalID(const sStateIDIf_c &id) const = 0;
50};
51
55public:
56 virtual bool isNormalID(const sStateIDIf_c &) const { return true; }
57};
58
62public:
63 virtual ~sStateMgrIf_c() {}
64 virtual void initializeState() = 0;
65 virtual void executeState() = 0;
66 virtual void finalizeState() = 0;
67 virtual void changeState(const sStateIDIf_c &newStateID) = 0;
68 virtual void refreshState() = 0;
69 virtual sStateIf_c *getState() const = 0;
70 virtual const sStateIDIf_c *getNewStateID() const = 0;
71 virtual const sStateIDIf_c *getStateID() const = 0;
72 virtual const sStateIDIf_c *getOldStateID() const = 0;
73};
74
The interface for state factories.
virtual void dispose(sStateIf_c *&id)=0
Clears out the pointer to a state.
virtual sStateIf_c * build(sStateIDIf_c const &id)=0
Returns a new state with a given state ID.
The interface for state ID checkers.
virtual bool isNormalID(const sStateIDIf_c &id) const =0
Returns whether a state ID is normal.
A default implementation of a state ID checker.
virtual bool isNormalID(const sStateIDIf_c &) const
Returns whether a state ID is normal.
The interface for state IDs.
virtual bool isEqual(const sStateIDIf_c &other) const =0
Returns whether both states have the same number.
virtual bool isSameName(const char *name) const =0
Returns whether this state ID is called name.
virtual const char * name() const =0
Returns the name of this state ID.
virtual unsigned int number() const =0
Returns the number of this state ID.
virtual bool isNull() const =0
Returns whether this is a null state.
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.
The interface for a state holder.
virtual const void execute()=0
Executes the state.
virtual const void initialize()=0
Initializes the state.
virtual const void finalize()=0
Prepares the state for termination.
The interface for state managers.
virtual const sStateIDIf_c * getStateID() const =0
Gets the current state ID.
virtual void executeState()=0
Executes the current state.
virtual sStateIf_c * getState() const =0
Gets the state holder.
virtual const sStateIDIf_c * getOldStateID() const =0
Gets the previous state ID.
virtual const sStateIDIf_c * getNewStateID() const =0
Gets the next state ID.
virtual void initializeState()=0
Initializes the current state.
virtual void refreshState()=0
Marks the current state to be executed again.
virtual void finalizeState()=0
Prepares the current state for termination.
virtual void changeState(const sStateIDIf_c &newStateID)=0
Transitions to a new state ID.