NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
sFStateID_c< T > Class Template Reference

#include <dol/sLib/s_FStateID.hpp>

Inheritance diagram for sFStateID_c< T >:
[legend]

Description

template<class T>
class sFStateID_c< T >

An implementation of a state ID for a given class.

It adds the ability to call the three state methods on a state owner class.

Template Parameters
TThe class that this state belongs to.

Definition at line 10 of file s_FStateID.hpp.

Public Types

typedef void(T::* stateFunc) ()
 

Public Member Functions

 sFStateID_c (const char *name, stateFunc initialize, stateFunc execute, stateFunc finalize)
 Constructs a new sFStateID_c instance.
 
virtual bool isSameName (const char *otherName) const
 Returns true if the given name matches this state ID's name.
 
virtual void initializeState (T &owner) const
 Calls the initialize method on the owner.
 
virtual void executeState (T &owner) const
 Calls the execute method on the owner.
 
virtual void finalizeState (T &owner) const
 Calls the finalize method on the owner.
 
- Public Member Functions inherited from sStateID_c
 sStateID_c (const char *name)
 
virtual bool isNull () const
 Returns whether this is a null state.
 
virtual bool isEqual (const sStateIDIf_c &other) const
 Returns whether both states have the same number.
 
virtual bool operator== (const sStateIDIf_c &other) const
 Overloaded equality operator, using isEqual.
 
virtual bool operator!= (const sStateIDIf_c &other) const
 Overloaded inequality operator, using isEqual.
 
virtual bool isSameName (const char *name) const
 Returns whether this state ID is called name.
 
virtual const char * name () const
 Returns the name of this state ID.
 
virtual unsigned int number () const
 Returns the number of this state ID.
 
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 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.
 

Private Attributes

stateFunc mpInitialize
 The initialize method for this state ID.
 
stateFunc mpExecute
 The execute method for this state ID.
 
stateFunc mpFinalize
 The finalize method for this state ID.
 

Additional Inherited Members

- Protected Attributes inherited from sStateID_c
const char * mpName
 The name of this state ID.
 
unsigned int mNumber
 The number of this state ID.
 
- Static Protected Attributes inherited from sStateID_c
static NumberMemo_c sm_numberMemo
 Used to give each state a unique number.
 

Member Typedef Documentation

◆ stateFunc

template<class T >
typedef void(T::* sFStateID_c< T >::stateFunc) ()

Definition at line 12 of file s_FStateID.hpp.

Constructor & Destructor Documentation

◆ sFStateID_c()

template<class T >
sFStateID_c< T >::sFStateID_c ( const char *  name,
stateFunc  initialize,
stateFunc  execute,
stateFunc  finalize 
)
inline

Constructs a new sFStateID_c instance.

Parameters
nameThe name of this state ID.
initializeThe initialize method for this state ID.
executeThe execute method for this state ID.
finalizeThe finalize method for this state ID.

Definition at line 22 of file s_FStateID.hpp.

Member Function Documentation

◆ isSameName()

template<class T >
virtual bool sFStateID_c< T >::isSameName ( const char *  otherName) const
inlinevirtual

Returns true if the given name matches this state ID's name.

Reimplemented from sStateID_c.

Definition at line 29 of file s_FStateID.hpp.

◆ initializeState()

template<class T >
virtual void sFStateID_c< T >::initializeState ( T &  owner) const
inlinevirtual

Calls the initialize method on the owner.

Parameters
ownerThe owner of this state ID.

Definition at line 44 of file s_FStateID.hpp.

◆ executeState()

template<class T >
virtual void sFStateID_c< T >::executeState ( T &  owner) const
inlinevirtual

Calls the execute method on the owner.

Parameters
ownerThe owner of this state ID.

Definition at line 48 of file s_FStateID.hpp.

◆ finalizeState()

template<class T >
virtual void sFStateID_c< T >::finalizeState ( T &  owner) const
inlinevirtual

Calls the finalize method on the owner.

Parameters
ownerThe owner of this state ID.

Definition at line 52 of file s_FStateID.hpp.

Member Data Documentation

◆ mpInitialize

template<class T >
stateFunc sFStateID_c< T >::mpInitialize
private

The initialize method for this state ID.

Definition at line 55 of file s_FStateID.hpp.

◆ mpExecute

template<class T >
stateFunc sFStateID_c< T >::mpExecute
private

The execute method for this state ID.

Definition at line 56 of file s_FStateID.hpp.

◆ mpFinalize

template<class T >
stateFunc sFStateID_c< T >::mpFinalize
private

The finalize method for this state ID.

Definition at line 57 of file s_FStateID.hpp.