add client
This commit is contained in:
24
src/client/Client.cpp
Normal file
24
src/client/Client.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <client/Client.h>
|
||||
|
||||
namespace td {
|
||||
namespace client {
|
||||
|
||||
void Client::Update() {
|
||||
auto timeElapsed = std::chrono::system_clock::now() - m_LastTime;
|
||||
float timeSeconds = std::chrono::duration<float, std::chrono::seconds::period>(timeElapsed).count();
|
||||
Update(timeSeconds);
|
||||
m_LastTime = std::chrono::system_clock::now();
|
||||
}
|
||||
|
||||
void Client::UpdateState(const std::shared_ptr<IClientState>& a_State) {
|
||||
m_State = a_State;
|
||||
m_State->SetClient(this);
|
||||
}
|
||||
|
||||
void Client::Update(float a_Delta) {
|
||||
assert(m_State);
|
||||
m_State->Update(a_Delta);
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user