début de la classe PiecesFile

This commit is contained in:
2025-02-28 22:32:51 +01:00
parent 26f501f7e8
commit 13ee43167e
11 changed files with 143 additions and 45 deletions

View File

@@ -1,8 +1,11 @@
#pragma once
#include "../Pieces/Piece.h"
#include "PiecesList.h"
#include <vector>
#include <memory>
#include <utility>
/**
@@ -10,16 +13,17 @@
*/
class Bag {
private:
std::vector<Piece> pieces; // the pieces the bag can dispense
int next; // the next piece to give
std::vector<int> currentBag; // the list of pieces that are still to be taken out before starting a new bag
std::vector<int> nextBag; // the list of pieces that have been taken out of the current bag and have been placed in the next
std::shared_ptr<PiecesList> piecesList; // the list of loaded pieces
std::vector<std::pair<int, int>> selectedPieces; // the list of pieces that can be given to the player
std::pair<int, int> next; // the next piece to give
std::vector<std::pair<int, int>> currentBag; // the list of pieces that are still to be taken out before starting a new bag
std::vector<std::pair<int, int>> nextBag; // the list of pieces that have been taken out of the current bag and have been placed in the next
public:
/**
* Creates a new bag of the specified list of pieces
* Creates a new bag with the pieces currently selected in the piece list
*/
Bag(const std::vector<Piece>& pieces);
Bag(std::shared_ptr<PiecesList> piecesList);
/**
* Looks at what the next picked piece will be, without removing it from the bag