blob: bccacd0a6ec07fe9f8fc5b33f62dad929fc5854d (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#pragma once
#include <utility>
#include "Command.h"
#include "KeyboardCode.h"
#include "MouseCode.h"
class View;
class Museum;
class ViewController {
public:
ViewController(Museum & m, View & v);
virtual ~ViewController();
public:
void update();
void ev_keydown(KeyboardCode code);
void ev_mousedown(MouseCode code);
void ev_mousemove(unsigned x, unsigned y);
public:
void set_artists_visible(bool visible) { this->draw_artists = visible; }
bool get_artists_visible() { return this->draw_artists; }
private:
void update_size();
void update_tiles();
void update_artists();
void update_pathfinding();
void update_quadtree();
private:
Museum & museum;
View & view;
const Command * cmd_base = nullptr;
bool draw_artists = true;
bool draw_pathfinding = false;
bool draw_quadtree = false;
private:
unsigned int scale = 16;
unsigned int line_width = 0;
unsigned int artist_size = (scale - line_width) / 2;
std::pair<float, float> mouse_pos = { 0, 0 };
};
|