Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 15 / Chess / Figures / Rook / Rook.cpp
blob: 2cb96a3f585627434d56b24b81c8ce1524c64cf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "Rook.h"

Rook::Rook(bool isWhite) : Figure(isWhite, RookFigure)
{}
bool Rook::canBeMoved(size_t currentX, size_t currentY, size_t destX, size_t destY) const
{
	return currentX == destX || currentY == destY;
}
void Rook::print() const
{
	if (getIsWhite())
		std::cout << 'R';
	else
		std::cout << 'r';
}