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

Queen::Queen(bool isWhite) : Bishop(isWhite), Rook(isWhite), Figure(isWhite)
{}

bool Queen::canBeMoved(size_t currentX, size_t currentY, size_t destX, size_t destY) const
{
	return Bishop::canBeMoved(currentX, currentY, destX, destY)
		|| Rook::canBeMoved(currentX, currentY, destX, destY);
}

void Queen::print() const
{
	if (getIsWhite())
		std::cout << 'Q';
	else
		std::cout << 'q';
}