#include "stdafx.h"
#include "Thinker.h"
#include <algorithm>

void Thinker::CheckIfNewHouse(const HouseInfo& newHouse) {
	auto it = std::find_if(m_HousesMemory.begin(), m_HousesMemory.end(),
		[&newHouse](const HouseMemory& house) {
		return house.info.Center == newHouse.Center;
	});

	if (it != m_HousesMemory.end()) {
		//it->lastSaw = std::chrono::steady_clock::now();
		//it->newHouse = false;
		return;
	}

	HouseMemory houseToMemory{};
	houseToMemory.info = newHouse;

	m_HousesMemory.push_back(houseToMemory);
}
