-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
#ifndef class_h | ||
#define class_h | ||
#include <iostream> | ||
#include <string> | ||
|
||
using std::cout; | ||
|
||
class Piece { | ||
|
||
public: | ||
Piece(Color color, PieceType type, int row, int col): //Конструктор | ||
color(color), type(type), row(row), col(col) {} | ||
|
||
getColor() const { | ||
return color; | ||
} //Цвет фигуры | ||
getType() const { | ||
return type; | ||
} //Тип фигуры | ||
|
||
int getRow() const { | ||
return row; | ||
} | ||
int getCol() const { | ||
return col; | ||
} | ||
void setRow(int newRow)const { | ||
row = newRow; | ||
} | ||
void setCol(int newCol) const { | ||
col = newCol; | ||
} | ||
|
||
private: | ||
Color color; | ||
PieceType type; | ||
int row; | ||
int col; | ||
} | ||
|
||
#endif |