Jeu d'échec
 
Loading...
Searching...
No Matches
square.cpp
Go to the documentation of this file.
1#include "square.hpp"
2
3std::string Square::to_string() const {
4 return {static_cast<char>(col + 97), static_cast<char>(row + 49)};
5}
6
7Square::Square(int row, int col) : row(row), col(col){}
8
9Square::Square(const std::string &str)
10{
11 col = static_cast<int>(str[0]) - 97;
12 row = (static_cast<int>(str[1]) - 49);
13}
std::string to_string() const
Renvoie la position "canonique" de la case.
Definition square.cpp:3
Square(int row, int col)
Constructeur de la classe.
Definition square.cpp:7