New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
FState.h
Go to the documentation of this file.
1#pragma once
2
3#include <state/FStateID.h>
4#include <state/IState.h>
5
6template <typename T>
7class FState : public IState
8{
9public:
10 FState(T& obj)
11 : mObject(obj)
12 , mStateID(nullptr)
13 {
14 }
15
16 T& getObject() const { return mObject; }
17
18 const StateID* getStateID() const override { return mStateID; }
19 void setStateID(const FStateID<T>* state_id) { mStateID = state_id; }
20
22 {
23 mStateID->initializeState(mObject);
24 }
25
27 {
28 mStateID->executeState(mObject);
29 }
30
31 void finalize()
32 {
33 mStateID->finalizeState(mObject);
34 }
35
36protected:
39};
Definition FState.h:8
const StateID * getStateID() const override
Definition FState.h:18
void finalize()
Definition FState.h:31
void execute() override
Definition FState.h:26
const FStateID< T > * mStateID
Definition FState.h:38
FState(T &obj)
Definition FState.h:10
void initialize()
Definition FState.h:21
T & getObject() const
Definition FState.h:16
T & mObject
Definition FState.h:37
void setStateID(const FStateID< T > *state_id)
Definition FState.h:19