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

#include "GrayTileBehavior.h"
#include "RedTileBehavior.h"
#include "Tile.h"

using namespace std;

GrayTileBehavior GrayTileBehavior::instance { GrayTileBehavior::type };

void GrayTileBehavior::update(Tile & tile) {
	if (this->interactions < 3) return; 
	tile.set_type(RedTileBehavior::type);
}

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