VariableStates.cpp
49 lines
| 955 B
| text/x-c
|
CppLexer
Alexandre Leroux
|
r806 | #include "Variable/VariableStates.h" | ||
AbstractVariableState::AbstractVariableState(StateData data) : m_Data{std::move(data)} | ||||
{ | ||||
} | ||||
StateData AbstractVariableState::data() const | ||||
{ | ||||
return m_Data; | ||||
} | ||||
Alexandre Leroux
|
r807 | |||
// /////////// // | ||||
// LoadedState // | ||||
// /////////// // | ||||
LoadedState::LoadedState() : AbstractVariableState{{{"color", "green"}}} | ||||
{ | ||||
} | ||||
std::unique_ptr<IVariableState> LoadedState::clone() const | ||||
{ | ||||
return std::make_unique<LoadedState>(*this); | ||||
} | ||||
// //////////// // | ||||
// LoadingState // | ||||
// //////////// // | ||||
LoadingState::LoadingState() : AbstractVariableState{{{"color", "blue"}}} | ||||
{ | ||||
} | ||||
std::unique_ptr<IVariableState> LoadingState::clone() const | ||||
{ | ||||
return std::make_unique<LoadingState>(*this); | ||||
} | ||||
// ///////////// // | ||||
// CanceledState // | ||||
// ///////////// // | ||||
CanceledState::CanceledState() : AbstractVariableState{{{"color", "red"}}} | ||||
{ | ||||
} | ||||
std::unique_ptr<IVariableState> CanceledState::clone() const | ||||
{ | ||||
return std::make_unique<CanceledState>(*this); | ||||
} | ||||