metaforce/Runtime/CMainFlow.cpp

40 lines
889 B
C++
Raw Normal View History

2015-08-20 02:52:07 +00:00
#include "CMainFlow.hpp"
2015-08-22 01:58:41 +00:00
#include "CArchitectureQueue.hpp"
#include "CMFGame.hpp"
2015-08-20 02:52:07 +00:00
namespace Retro
{
2015-08-22 01:58:41 +00:00
void CMainFlow::AdvanceGameState(CArchitectureQueue& queue)
{
}
void CMainFlow::SetGameState(EClientFlowStates state, CArchitectureQueue& queue)
{
switch (state)
{
case StateGameLoad:
queue.PushMessage(std::move(MakeMsg::CreateCreateIOWin(TargetMainFlow, 10, 1000, new CMFGameLoader())));
break;
default: break;
}
}
bool CMainFlow::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
2015-08-20 02:52:07 +00:00
{
switch (msg.GetType())
{
case MsgTimerTick:
2015-08-22 01:58:41 +00:00
AdvanceGameState(queue);
break;
case MsgSetGameState:
2015-08-20 02:52:07 +00:00
{
2015-08-22 01:58:41 +00:00
CArchMsgParmInt32 state = MakeMsg::GetParmNewGameflowState(msg);
SetGameState(EClientFlowStates(state.m_parm), queue);
return true;
2015-08-20 02:52:07 +00:00
}
default: break;
}
2015-08-22 01:58:41 +00:00
return false;
2015-08-20 02:52:07 +00:00
}
}