From 57fa7bb12084288813da982f5b7177791673a393 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 31 Dec 2023 03:30:02 +0100 Subject: [PATCH] get piece pos --- includes/Piece.hpp | 3 +++ src/Piece.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/includes/Piece.hpp b/includes/Piece.hpp index 097c6b3..019e70e 100644 --- a/includes/Piece.hpp +++ b/includes/Piece.hpp @@ -34,4 +34,7 @@ public: // Renvoie la couleur de la pièce pour l'affichage virtual sf::Color getScreenColor() const = 0; + + // Renvoie la position de la pièce + std::pair getPos() const; }; diff --git a/src/Piece.cpp b/src/Piece.cpp index 89fa5e5..4888131 100644 --- a/src/Piece.cpp +++ b/src/Piece.cpp @@ -31,3 +31,7 @@ void Piece::changeSelection() { bool Piece::isSelectionnee() const { return selected; } + +std::pair Piece::getPos() const { + return std::make_pair(x, y); +}