fixes
This commit is contained in:
parent
9a60ee5eb6
commit
3582844e5c
3 changed files with 6 additions and 5 deletions
|
@ -33,7 +33,7 @@ void Dames::play() {
|
|||
void Dames::event(const int, const int) {}
|
||||
|
||||
const std::pair<const int, const int> Dames::getPosition() const {
|
||||
if (posCurseur.first > plateau.getTaille() - 1) {
|
||||
if (posCurseur.second > plateau.getTaille() - 1) {
|
||||
std::cerr << "Position inconnu du plateau.\n";
|
||||
return std::make_pair(-1, -1);
|
||||
}
|
||||
|
|
|
@ -119,10 +119,11 @@ Piece *Plateau::getPiece(const int x, const int y) const {
|
|||
|
||||
const std::pair<const int, const int>
|
||||
Plateau::trouveCoordonnees(const int x, const int y) const {
|
||||
const float tailleCellule = static_cast<float>(Ecran::largeur()) / taille;
|
||||
const float tailleCelluleX = static_cast<float>(Ecran::largeur()) / taille;
|
||||
const float tailleCelluleY = static_cast<float>(Ecran::hauteur()) / taille;
|
||||
|
||||
return std::make_pair(static_cast<int>(x / tailleCellule),
|
||||
static_cast<int>(y / tailleCellule));
|
||||
return std::make_pair(static_cast<int>(x / tailleCelluleX),
|
||||
static_cast<int>(y / tailleCelluleY));
|
||||
}
|
||||
|
||||
int Plateau::getTaille() const {
|
||||
|
|
|
@ -34,7 +34,7 @@ void Safari::play() {
|
|||
void Safari::event(const int, const int) {}
|
||||
|
||||
const std::pair<const int, const int> Safari::getPosition() const {
|
||||
if (posCurseur.first > plateau.getTaille() - 1) {
|
||||
if (posCurseur.second > plateau.getTaille() - 1) {
|
||||
std::cerr << "Position inconnu du plateau.\n";
|
||||
return std::make_pair(-1, -1);
|
||||
}
|
||||
|
|
Reference in a new issue