|
|
@ -19,7 +19,7 @@ |
|
|
|
#include "Speichern.h" |
|
|
|
#include "Tutorial.h" |
|
|
|
|
|
|
|
bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Player player) { |
|
|
|
bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Player player, int anzahl_Zuege, int** Historie) { |
|
|
|
|
|
|
|
if ((endX >= 8 || endY >= 8) || (endX < 0 || endY < 0)){ |
|
|
|
return false; |
|
|
@ -60,7 +60,18 @@ bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Pla |
|
|
|
break; |
|
|
|
case 'P': |
|
|
|
//Datei von Bauer aufrufen |
|
|
|
return (istzugerlaubt_Bauer(Brett, startX,startY,endX,endY,player)); |
|
|
|
if(istzugerlaubt_Bauer(Brett,startX,startY,endX,endY,player) == true){ |
|
|
|
if(bauer_umwandel_abfrage(Brett,startX,startY,endX,endY,player)!= NULL){ |
|
|
|
printf("Return false"); |
|
|
|
return false; |
|
|
|
}else |
|
|
|
printf("Return true"); |
|
|
|
return true; |
|
|
|
}else if(ist_En_Passaut_erlaubt_Bauer(Brett,startX,startY,endX,endY,player,anzahl_Zuege,Historie)){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
@ -90,7 +101,18 @@ bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Pla |
|
|
|
break; |
|
|
|
case 'p': |
|
|
|
//Datei von Bauer aufrufen |
|
|
|
return (istzugerlaubt_Bauer(Brett, startX,startY,endX,endY,player)); |
|
|
|
if(istzugerlaubt_Bauer(Brett,startX,startY,endX,endY,player)){ |
|
|
|
if(bauer_umwandel_abfrage(Brett,startX,startY,endX,endY,player)){ |
|
|
|
printf("Return false"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
printf("Return true"); |
|
|
|
return true; |
|
|
|
}else if(ist_En_Passaut_erlaubt_Bauer(Brett,startX,startY,endX,endY,player,anzahl_Zuege,Historie)){ |
|
|
|
return true; |
|
|
|
}else{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
@ -108,10 +130,10 @@ bool istzugerlaubt(char** Brett, int startX, int startY, int endX, int endY, Pla |
|
|
|
*/ |
|
|
|
return true; |
|
|
|
} |
|
|
|
void machezug(char** Brett, int startX, int startY, int endX, int endY,Player player) { |
|
|
|
void machezug(char** Brett, int startX, int startY, int endX, int endY,Player player, int anzahl_Zuege, int** Historie) { |
|
|
|
//wenn istzugerlaubt true ist wird das hier ausgeführt |
|
|
|
|
|
|
|
if(istzugerlaubt(Brett,startX,startY,endX,endY,player) == true){ |
|
|
|
if(istzugerlaubt(Brett,startX,startY,endX,endY,player,anzahl_Zuege,Historie) == true){ |
|
|
|
Brett[endY][endX] = Brett[startY][startX]; |
|
|
|
Brett[startY][startX] = ' '; |
|
|
|
} |
|
|
|