add StateMachine

This commit is contained in:
2025-08-09 11:23:17 +02:00
parent ac3e949323
commit cba790f804
23 changed files with 174 additions and 244 deletions

View File

@@ -3,22 +3,7 @@
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