aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/cell_helper.hpp
blob: bcc0a89c0197b629247c11f8493404fd56289fbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <memory>
#include <vector>
#include <yacppdic/factory.hpp>

#include "engine/data/vector2.hpp"
#include "interfaces/matrix.hpp"

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class ICellHelper
{
public:
	virtual ~ICellHelper() noexcept = default;

	[[nodiscard]] virtual auto
	compute_is_cell_dying(const Vector2 &cell_pos) const noexcept -> bool = 0;

	[[nodiscard]] virtual auto compute_birth_cell_positions(
		const std::vector<Vector2> &cell_positions) const noexcept
		-> std::vector<Vector2> = 0;
};

template <typename MatrixElement>
using ICellHelperFactory = yacppdic::Factory<std::unique_ptr<ICellHelper>(
	const std::shared_ptr<IMatrix<MatrixElement>> &matrix)>;