-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRed_piece.cpp
More file actions
50 lines (47 loc) · 1.07 KB
/
Red_piece.cpp
File metadata and controls
50 lines (47 loc) · 1.07 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
44
45
46
47
48
49
50
#include "Red_piece.h"
#include"Global.h"
#include<iostream>
using namespace std;
Red_piece::Red_piece(Position pos, char id, DIRECTION dir, COLOR col)
:Piece(pos, id, dir,col)
{
}
//void Red_piece::drawPiece(sf::RenderWindow& window)
//{
// image_piece.setTexture(Global::Ts[1]);
// image_piece.setScale((float)Global::dimSqr.x / Global::Ts[1].getSize().x, (float)Global::dimSqr.y / Global::Ts[1].getSize().y);
// image_piece.setPosition((float)Global::dimSqr.x * P_pos.ci, (float)Global::dimSqr.y * P_pos.ri);
// window.draw(image_piece);
//}
//char Red_piece::getId_piece()
//{
// return this->P_id;
//}
//bool Red_piece::Isfirst(Position P)
//{
// First_Init();
// for (int i = 0; i < 4; i++)
// {
// if (First[i].ri ==P.ri && First[i].ci == P.ci)
// {
// return true;
// }
// }
// return false;
//}
void Red_piece::First_Init()
{
Position ps[4];
ps[0].ri = 1;
ps[0].ci = 10;
ps[1].ri = 1;
ps[1].ci = 13;
ps[2].ri = 4;
ps[2].ci = 10;
ps[3].ri = 4;
ps[3].ci = 13;
for (int i = 0; i < 4; i++)
{
First.push_back(ps[i]);
}
}