summaryrefslogtreecommitdiff
path: root/src/helper.hpp
diff options
context:
space:
mode:
authorStephen Enders <smenders@gmail.com>2022-02-12 12:31:27 -0500
committerStephen Enders <smenders@gmail.com>2022-02-12 12:31:27 -0500
commit88c364d3bbcc5c3ea78abb7051c161eb87c00bb3 (patch)
treef15ddad81a8e146e14bfc4900ba5f995ef7734d8 /src/helper.hpp
parent66a34966ca14bc5158b244ddded2a1d80fe8cc88 (diff)
Create win sequence
You can now win the game when you reach a score of 7 This is proxied simply by "does the player have any remaining pieces to play".
Diffstat (limited to 'src/helper.hpp')
-rw-r--r--src/helper.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/helper.hpp b/src/helper.hpp
index f7d6b8d..e13ee5e 100644
--- a/src/helper.hpp
+++ b/src/helper.hpp
@@ -34,6 +34,8 @@ static const int ROLL_TILES[2] = { 20, 21 };
static const int PASS_TILES[3] = { 24, 25, 26 };
static const int START_TILES[3] = { 27, 28, 29 };
static const int REROLL_POS[3] = { 3, 7, 13 };
+static const int P1_WIN_TILES[5] = { 30, 31, 32, 33, 34 };
+static const int P2_WIN_TILES[5] = { 35, 36, 37, 38, 39 };
static const char* TITLE = "Royal Game of Ur";
static const sf::Color GLOBAL_MASK(255, 0, 255, 255);
@@ -101,6 +103,10 @@ std::shared_ptr<std::vector<sf::Sprite>>
createPassSprites(std::shared_ptr<std::vector<sf::Texture>> textures);
std::shared_ptr<std::vector<sf::Sprite>>
+createWinSprites(int player_id,
+ std::shared_ptr<std::vector<sf::Texture>> textures);
+
+std::shared_ptr<std::vector<sf::Sprite>>
createStartSprites(std::shared_ptr<std::vector<sf::Texture>> textures);
void
@@ -137,4 +143,7 @@ void
clearPiece(std::shared_ptr<std::vector<struct piece_t>> pieces,
struct piece_t* piece);
+bool
+hasWon(std::shared_ptr<struct player_t> player);
+
#endif