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

#include <vector>

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

class Canvas {
public:
	Canvas() = default;
	virtual ~Canvas();

public:
	virtual Tile & get_tile(unsigned x, unsigned y);
	virtual void set_tile(unsigned x, unsigned y, TileData data);

public:
	CanvasData data;
	void update();

private:
	std::vector<Tile *> tiles;

private:
	size_t pos_to_index(unsigned x, unsigned y);
};