initial commit

This commit is contained in:
2025-02-25 12:07:16 +01:00
commit 0657bc9b25
34 changed files with 3069 additions and 0 deletions

39
src/Core/Bag.h Normal file
View File

@@ -0,0 +1,39 @@
#pragma once
#include "../Pieces/Piece.h"
#include <Vector>
/**
* A litteral bag of pieces, in which you take each of its piece randomly one by one then start again with a new bag
*/
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
public:
/**
* Creates a new bag of the specified list of pieces
*/
Bag(const std::vector<Piece>& pieces);
/**
* Looks at what the next picked piece will be
*/
Piece lookNext();
/**
* Picks a new piece from the current bag
*/
Piece getNext();
private:
/**
* Prepare the next picked piece in advance
*/
void prepareNext();
};