NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
s_FStateFct.hpp
1#pragma once
2#include <game/sLib/s_StateInterfaces.hpp>
3#include <game/sLib/s_FState.hpp>
4#include <game/sLib/s_StateID.hpp>
5
9template <class T>
11public:
12 sFStateFct_c(T &owner) : mState(owner) {}
13
14 virtual sStateIf_c* build(const sStateIDIf_c &id) {
15 if (!id.isNull()) {
16 mState.setID((const sFStateID_c<T> *) &id);
17 return &mState;
18 }
19 return nullptr;
20 }
21
22 virtual void dispose(sStateIf_c *&id) { id = nullptr; }
23
24private:
25 sFState_c<T> mState;
26};
A state factory for a given class.
virtual sStateIf_c * build(const sStateIDIf_c &id)
Returns a new state with a given state ID.
virtual void dispose(sStateIf_c *&id)
Clears out the pointer to a state.
An implementation of a state ID for a given class.
A state holder for a given class.
Definition s_FState.hpp:9
The interface for state factories.
The interface for state IDs.
The interface for a state holder.