diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 16:09:47 +0200 | 
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 16:09:47 +0200 | 
| commit | 277157b3e06b2deeacbdbc8bf6190de19f88169d (patch) | |
| tree | db9c013b67f93d27fa5bb9cf84c7d6dc53f72734 /TileColorFactory.cpp | |
| parent | 64028952ceb17f97ded08f1ab7ec0b06c41e2b87 (diff) | |
more refactoring / preparation for pathfinding
Diffstat (limited to 'TileColorFactory.cpp')
| -rw-r--r-- | TileColorFactory.cpp | 14 | 
1 files changed, 5 insertions, 9 deletions
| diff --git a/TileColorFactory.cpp b/TileColorFactory.cpp index 7c5b080..22738f6 100644 --- a/TileColorFactory.cpp +++ b/TileColorFactory.cpp @@ -2,18 +2,14 @@  using namespace std; -Color TileColorFactory::get_color(string type) { -	auto & type_map = TileColorFactory::get_collection(); - -	if (type_map.contains(type)) -		return type_map.at(type); +const Color & TileColorFactory::get_color(const string & type) { +	if (this->collection.contains(type)) +		return this->collection.at(type);  	return TileColorFactory::default_color;  } -void TileColorFactory::register_color(string type, Color color) { -	auto & type_map = TileColorFactory::get_collection(); - -	type_map[type] = color; +void TileColorFactory::register_color(const string & type, const Color & color) { +	this->collection[type] = color;  } |