aboutsummaryrefslogtreecommitdiff
path: root/Museum.h
blob: 33ad7e1604a19b9d630aa6728cb8e27639556a2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include <thread>
#include <chrono>

using namespace std::chrono_literals;

#include "People.h"
#include "Canvas.h"

class Museum {
public:
	Museum();
	virtual ~Museum();

public:
	People people;
	Canvas canvas;

public:
	void set_pause(bool paused);
	bool get_pause() { return this->paused; }
	void update();

private:
	unsigned long long tick = 0;
	bool paused = false;

private:
	static constexpr std::chrono::milliseconds tick_interval = 15ms;
	bool working = true;
	std::thread * worker = nullptr;
	void work();
};