petits [[nodiscard]] pour le fun
All checks were successful
Linux arm64 / Build (push) Successful in 12m30s

This commit is contained in:
2025-06-19 22:31:41 +02:00
parent 34d781fcfe
commit 8342bf3969
6 changed files with 38 additions and 23 deletions

View File

@@ -4,7 +4,7 @@
#include "Player.h"
#include "Game.h"
static const int FRAMES_PER_SECOND = 60; // the number of frames per second, all the values in the app were choosen with this number in mind
static const int FRAMES_PER_SECOND = 60; // the number of frames per second, all the values in the app were choosen with this number in mind
/**

View File

@@ -27,13 +27,12 @@ PiecesList::PiecesList() {
this->pushBackEmptyVectors();
}
bool PiecesList::loadPieces(int size) {
if (size < 1) return false;
if (size <= this->highestLoadedSize) return true;
bool PiecesList::loadPieces(int max_size) {
if (max_size < 1) return false;
if (max_size <= this->highestLoadedSize) return true;
PiecesFiles piecesFiles;
for (int i = this->highestLoadedSize + 1; i <= size; i++) {
for (int i = this->highestLoadedSize + 1; i <= max_size; i++) {
if (!piecesFiles.loadPieces(i, this->loadedPieces.at(i), this->convexPieces.at(i), this->holelessPieces.at(i), this->otherPieces.at(i))) {
return false;
}

View File

@@ -30,10 +30,10 @@ class PiecesList {
PiecesList();
/**
* Makes the list load all pieces of the specified size
* @return If it sucessfully loaded the pieces
* Makes the list load all pieces up to the specified size
* @return If all pieces up to the specified size are correctly loaded
*/
bool loadPieces(int size);
[[nodiscard]] bool loadPieces(int max_size);
/**
* Selects the specified piece