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

#include "GrayTileBehavior.h"
#include "Tile.h"
#include "TileData.h"

using namespace std;

GrayTileBehavior GrayTileBehavior::instance {"G"};

void GrayTileBehavior::update(Tile & tile) {
	if (this->interactions < 3) return; 
	TileData new_data = tile.data;
	new_data.type = "R";
	tile.set_data(new_data);
}

unique_ptr<TileBehaviorStrategy> GrayTileBehavior::clone(Museum & museum) {
	auto instance = new GrayTileBehavior();
	instance->museum = &museum;
	return unique_ptr<TileBehaviorStrategy>(instance);
}