aboutsummaryrefslogtreecommitdiff
path: root/Tile.cpp
blob: cb7b89b2de7646a892e97a44f6d7992ca14fd869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <cstdio>

#include "Tile.h"
#include "TileAppearance.h"
#include "TileBehavior.h"

Tile::Tile() {
	this->data = {};
	this->update();
}

Tile::Tile(TileData data) {
	this->data = data;
	this->update();
}

void Tile::update() {
	this->color = TileAppearance::get_color(this->data.type);
	this->behavior = TileBehavior::get_strategy(this->data.type).clone();
}