initial commit
This commit is contained in:
37
src/Pieces/PiecesFiles.h
Normal file
37
src/Pieces/PiecesFiles.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "Piece.h"
|
||||
|
||||
#include <Vector>
|
||||
#include <String>
|
||||
|
||||
|
||||
/**
|
||||
* Manages creating pieces files and importing the data back from them
|
||||
*/
|
||||
class PiecesFiles {
|
||||
public:
|
||||
/**
|
||||
* Initializes file manager
|
||||
*/
|
||||
PiecesFiles();
|
||||
|
||||
/**
|
||||
* Generate a file containing all the pieces of the specified size,
|
||||
* returns false if the file couldn't be created
|
||||
*/
|
||||
bool savePieces(int order) const;
|
||||
|
||||
/**
|
||||
* Replace the content of the vectors by the pieces of the specified size, if the file wasn't found the vectors stays untouched,
|
||||
* returns false if the file wasn't found
|
||||
*/
|
||||
bool loadPieces(int order, std::vector<Piece>& pieces, std::vector<int>& convexPieces, std::vector<int>& holelessPieces, std::vector<int>& 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,
|
||||
* returns false if the data folder wasn't found
|
||||
*/
|
||||
bool getFilePath(int order, std::string& filePath) const;
|
||||
};
|
||||
Reference in New Issue
Block a user