QtDesignPatterns/statepattern/context.h

22 lines
254 B
C
Raw Permalink Normal View History

2024-02-06 17:21:37 +08:00
class State;
class Context
{
public:
Context()
{
state = nullptr;
}
void setState(State *state)
{
this->state = state;
}
State*getState()
{
return this->state;
}
private:
State *state;
};