move ClientSimulation in Client

This commit is contained in:
2025-08-10 12:19:50 +02:00
parent 8bdcffcfa6
commit e0080fa50c
8 changed files with 59 additions and 54 deletions

View File

@@ -14,7 +14,7 @@ using GameBuffer = std::vector<std::optional<td::protocol::LockStep>>;
class ClientSimulation : public protocol::PacketHandler {
private:
std::uint64_t m_StepTime;
game::World& m_World;
std::shared_ptr<game::World> m_World;
GameBuffer m_History;
float m_CurrentTime;
StepTime m_CurrentStep;
@@ -33,13 +33,13 @@ class ClientSimulation : public protocol::PacketHandler {
* \brief Replay constructor
* \param a_StepTime in ms
*/
ClientSimulation(game::World& a_World, GameHistory&& a_History, std::uint64_t a_StepTime);
ClientSimulation(std::shared_ptr<game::World> a_World, GameHistory&& a_History, std::uint64_t a_StepTime);
/**
* \brief Live update constructor (continuous game updates)
* \param a_StepTime in ms
*/
ClientSimulation(game::World& a_World, std::uint64_t a_StepTime);
ClientSimulation(std::shared_ptr<game::World> a_World, std::uint64_t a_StepTime);
/**
* \return the progress [0-1] between two steps