mis en place la PR de simon sur les couleurs

This commit is contained in:
2025-02-28 18:42:04 +01:00
parent f0f391ade6
commit 26f501f7e8
29 changed files with 713 additions and 665 deletions

View File

@@ -2,9 +2,9 @@
#include "Polyomino.h"
#include <Vector>
#include <Set>
#include <Map>
#include <vector>
#include <set>
#include <map>
/**
@@ -13,27 +13,28 @@
class Generator {
private:
std::vector<Polyomino> validPolyominos; // the list of already generated polyominos
std::set<Cell> currentTestedShape; // the polyomino being created
std::set<Position> currentTestedShape; // the polyomino being created
public:
/**
* Initializes generator
* Default constructor
*/
Generator();
/**
* Returns the list of all one-sided polyominos of the specified size
* Generates the list of all one-sided polyominos of the specified size
* @return The list of polyominos
*/
std::vector<Polyomino> generatePolyominos(unsigned int order);
std::vector<Polyomino> generatePolyominos(unsigned int polyominoSize);
private:
/**
* Generates all one-sided polyominos of the specified using the current tested shape
* Generates all one-sided polyominos of the specified size using the current tested shape
*/
void generate(unsigned int order, int lastAddedCellNumber, int nextAvaibleNumber, std::map<Cell, int> candidateCells);
void generate(unsigned int polyominoSize, int lastAddedPositionNumber, int nextAvaibleNumber, std::map<Position, int> candidatePositions);
/**
* Check wheter a candidate cell can be added to the current tested shape
* Checks wheter a candidate position can be added to the current tested shape
*/
void tryToAddCandidateCell(const Cell& candidate, int& nextAvaibleNumber, std::map<Cell, int>& candidateCells);
void tryToAddCandidatePosition(const Position& candidate, int& nextAvaibleNumber, std::map<Position, int>& candidatePositions);
};