#pragma once #include "Polyomino.h" #include #include #include /** * A generator of one-sided polyominos of any size */ class Generator { private: std::vector validPolyominos; // the list of already generated polyominos std::set currentTestedShape; // the polyomino being created public: /** * Default constructor */ Generator(); /** * Generates the list of all one-sided polyominos of the specified size * @return The list of polyominos */ std::vector generatePolyominos(int polyominoSize); private: /** * Generates all one-sided polyominos of the specified size using the current tested shape */ void generate(int polyominoSize, int lastAddedPositionNumber, int nextAvaibleNumber, std::map candidatePositions); /** * Checks wheter a candidate position can be added to the current tested shape */ void tryToAddCandidatePosition(const Position& candidate, int& nextAvaibleNumber, std::map& candidatePositions); };