Refactoring. Client and server has Update Loop that runs before any game logic each frame.

This commit is contained in:
stiffly
2015-12-15 14:53:56 +01:00
parent 0a8a9e5099
commit 478c692315
8 changed files with 88 additions and 57 deletions
+5 -2
View File
@@ -89,6 +89,9 @@ void Game::Tick()
m_InputProxy->Process();
m_EventBroker->Swap();
// Update network
m_IsClient ? m_Client.Update() : m_Server.Update();
// Iterate through systems and update world!
m_SystemPipeline->Update(m_World, dt);
debugTick(dt);
@@ -135,11 +138,11 @@ void Game::NetworkFunction()
std::cout << "Start client or server? (c/s)" << std::endl;
std::cin >> inputMessage;
if (inputMessage == "c" || inputMessage == "C") {
Client m_Client;
m_IsClient = true;
m_Client.Start(m_World, m_EventBroker);
}
if (inputMessage == "s" || inputMessage == "S") {
Server m_Server;
m_IsClient = false;
m_Server.Start(m_World, m_EventBroker);
}
}