-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKnight.h
More file actions
43 lines (34 loc) · 1.04 KB
/
Copy pathKnight.h
File metadata and controls
43 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Knight.h
// Created by hassid on 1/3/18.
//
#ifndef CHESS_KNIGHT_H
#define CHESS_KNIGHT_H
#include "Piece.h"
/** Class representing a Knight piece at a chess game. */
class Knight: public Piece
{
public:
/**
* for using same constractor.
*/
using Piece::Piece;
/**
* returns a vector with the places we want to move
* @param pos current position
* @param dest desired position
* @return vector with the places we want to move
*/
const std::vector<PosVar> move(PosVar pos, PosVar dest) const override;
/** get all possible moves from given pos of a piece
* @param pos the current position of the piece
* @return a vector containing all possible positions
*/
const std::vector<PosVar> getAllMoves(PosVar pos) const override;
/**
* @return a print representation of the Knight. first place - color, sec - the string of the Knight
*/
std::pair <Color, std::string> getPrint() const override;
private:
const static std::string KNIGHT_PRINT;
};
#endif //CHESS_KNIGHT_H