add client

This commit is contained in:
2025-08-08 13:24:50 +02:00
parent b09c7f9efd
commit ac3e949323
14 changed files with 306 additions and 33 deletions

24
src/client/Client.cpp Normal file
View 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