aboutsummaryrefslogtreecommitdiff
path: root/Canvas.h
blob: b602fb2bc65fcc38dd6265d407f952de03d61adc (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
#pragma once

#include <string>
#include <vector>

#include "CanvasData.h"
#include "Tile.h"
#include "XY.h"

#include "TileBehaviorFactory.h"
#include "TileColorFactory.h"

class Museum;

class Canvas {
public:
	Canvas(Museum &);
	virtual ~Canvas();
	std::string to_string(bool truecolor = false);

public:
	virtual Tile & get_tile(const XY &);
	virtual void set_tile(TileData data);

public:
	CanvasData data;
	void update();
	void set_data(CanvasData data);

public:
	TileColorFactory tile_color;
	TileBehaviorFactory tile_behavior;

private:
	void update_steps();
	void update_tiles();

private:
	std::vector<Tile *> tiles;
	virtual Tile * & get_tile_unsafe(const XY &);

private:
	Museum & museum;
};