#pragma once #include #include #include #include #include "People.h" #include "Canvas.h" #include "CollisionContext.h" #include "PathfindingContext.h" using namespace std::chrono_literals; class Museum { public: Museum(); virtual ~Museum(); public: People people; Canvas canvas; CollisionContext collision; PathfindingContext pathfinding; public: bool paused = true; void update(); void skip_forward(); void skip_backward(); private: int jump = 0; std::mutex jump_mutex; void process_jump(); private: bool working = true; std::thread * worker = nullptr; void work(); private: unsigned long long tick = 0; static constexpr std::chrono::milliseconds tick_interval = 15ms; private: static constexpr unsigned snapshot_ticks = 50; struct Snapshot { unsigned long long tick; Memories memories; }; std::stack> history; Snapshot save_snapshot(); void restore_snapshot(const Snapshot &); };