-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiece.h
More file actions
33 lines (29 loc) · 920 Bytes
/
Piece.h
File metadata and controls
33 lines (29 loc) · 920 Bytes
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
#ifndef PIECE_H
#define PIECE_H
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
struct Int2 {
int a[2];
};
class Piece {
public:
int posx, posy, value, timesMoved;
bool inCheck = false;
vector<Piece*> attackers, defenders, attacking, defending;
vector<Int2> coveredTiles, moveableTiles;
char pieceType, color;
Piece();
~Piece();
Piece(int, int, char);
virtual bool moveIsValid(int, int, string (*)[8]) = 0;
virtual bool captureIsValid(int, int, string (*)[8]) = 0;
virtual bool captureIsValid2(int, int, string, string (*)[8], Piece**, bool &) = 0;
virtual void move(int, int, string (*)[8], Piece**) = 0;
virtual void update(string, string (*)[8], Piece**) = 0;
bool addCoveredTile(int, int, string(*)[8], Piece**);
void print();
};
#endif