#pragma once #include "Piece.h" #include #include /** * Manages creating pieces files and importing the data back from them */ class PiecesFiles { public: /** * Default constructor */ PiecesFiles(); /** * Generate a file containing all the pieces of the specified size * @return If the file could be created */ bool savePieces(int polyominoSize) const; /** * Replace the content of the vectors by the pieces of the specified size, if the file wasn't found the vectors stays untouched * @return If the file was found */ bool loadPieces(int polyominoSize, std::vector& pieces, std::vector& convexPieces, std::vector& holelessPieces, std::vector& otherPieces) const; private: /** * Puts the path to the piece file of the specified size in order, if the data folder wasn't found the string stays untouched * @return If the data folder was found */ bool getFilePath(int polyominoSize, std::string& filePath) const; };