Jeu d'échec
 
Loading...
Searching...
No Matches
square.hpp
Go to the documentation of this file.
1#ifndef SQUARE_HPP
2#define SQUARE_HPP
3
4#include <string>
5
7class Square{
8 private:
10 int row, col;
11 public:
15 void get_row_col(int& row, int& col) const{
16 row = this->row;
17 col = this->col;
18 };
19
22 int get_row() const { return row; }
23
26 int get_col() const { return col; }
27
30 std::string to_string() const;
31
35 Square(int row, int col);
36
38 explicit Square(const std::string &);
39};
40
41#endif
Décrit une case de l'échiquier.
Definition square.hpp:7
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
int get_row() const
Récupère la ligne où se trouve la pièce.
Definition square.hpp:22
int get_col() const
Récupère la colonne où se trouve la pièce.
Definition square.hpp:26
void get_row_col(int &row, int &col) const
Récupère la ligne et la colonne décrite par l'objet.
Definition square.hpp:15