-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhuman.cpp
More file actions
44 lines (40 loc) · 1.32 KB
/
human.cpp
File metadata and controls
44 lines (40 loc) · 1.32 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
#include "human.h"
void Human::parseCard(std::string card)
{
for(int i = 0; i < cardsSize; i++){
if(card == cards[i]){
if(cards[i][0] == 'J'){
jackKol++;
}
else{
jackKol = 0;
}
mainWindow->setJackchoose("");
mainWindow->hideLable3();
mainWindow->setTable(cards[i]);
const std::string* newtable = mainWindow->getTable();
const int newtableSize = mainWindow->getTableSize();
delete buttons[cardsSize - 1];
cards[i] = "";
for(int j = i; j < cardsSize - 1; j++){
cards[j] = cards[j + 1];
cards[j + 1] = "";
}
cardsSize--;
if(mainWindow->isBridge())
mainWindow->setBridge(false);
if(cardsSize > 0 || newtable[newtableSize - 1][0] == '6'){
checkForTake = 0;
int mv = mainWindow->isMove();
mainWindow->secondmove();
mainWindow->operation(mv);
}
mainWindow->AutoSave();
mainWindow->gameChange();
if(newtable[newtableSize - 1][0] != '6' && !mainWindow->isBridge()){
mainWindow->gameEnd();
}
break;
}
}
}