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 51 52 53 54
|
void Game::DisplayInformation()
{
//
// Scoring
char buffer[250];
char t1[10];
char t2[10];
char t3[10];
_itoa_s (TotalWhite,t1,10); //the number given by TotalWhite into a chain of caracters
_itoa_s (TotalBlack,t2,10);
strcpy_s(buffer,"White : ");
strcat_s(buffer,t1);
Text(10, HEIGHT+10, screen, buffer);
strcpy_s(buffer,"Black : ");
strcat_s(buffer,t2);
Text(10, HEIGHT+30, screen, buffer);
//Round: white or black?
strcpy_s(buffer,"Round : ");
strcat_s(buffer,(round == White ? "White" : "Black"));
Text(WIDTH-320, HEIGHT+30, screen, buffer);
//Chronometer
if(round != Empty)
{
time (&end_t);
int dif = (int)difftime (end,start);
_itoa_s (dif,t3,10);
strcpy_s(buffer,"Time : ");
strcat_s(buffer,t3);
strcat_s(buffer," s");
}
else
{
strcpy_s(buffer,"Time : ");
}
Text(WIDTH-160, HEIGHT+10, screen, buffer);
//Display the type of the opponent
bool vsCPU = getAgainstCPU();
strcpy_s(buffer,"Opponent : ");
strcat_s(buffer,(vsCPU == true ? "CPU" : "Player"));
Text(WIDTH-160, HEIGHT+30, screen, buffer);
//Winner?
CheckEnd();
} |
Partager