Skip to content
Snippets Groups Projects
Commit e73b3387 authored by Sam Moore's avatar Sam Moore
Browse files

Made printed board consistent with graphical board

I made the graphical board draw function reveal pieces that had been involved in combat.
But I didn't reflect this in the printed board, until now.

Pointed out by [SLX]
parent c4988773
Branches
Tags
No related merge requests found
...@@ -157,7 +157,7 @@ void Board::Print(FILE * stream, const Piece::Colour & reveal) ...@@ -157,7 +157,7 @@ void Board::Print(FILE * stream, const Piece::Colour & reveal)
* @param stream - the stream to print information to * @param stream - the stream to print information to
* @param reveal - Pieces matching this colour will have their identify revealed, other pieces will be shown as '#' * @param reveal - Pieces matching this colour will have their identify revealed, other pieces will be shown as '#'
*/ */
void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal) void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal, bool showRevealed)
{ {
for (int y=0; y < height; ++y) for (int y=0; y < height; ++y)
{ {
...@@ -168,7 +168,8 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal) ...@@ -168,7 +168,8 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal)
{ {
fprintf(stream, "."); fprintf(stream, ".");
} }
else if (piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH)) else if ((piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH))
|| (piece->beenRevealed && showRevealed))
{ {
switch (piece->colour) switch (piece->colour)
{ {
......
...@@ -109,7 +109,7 @@ class Board ...@@ -109,7 +109,7 @@ class Board
virtual ~Board(); //Destructor virtual ~Board(); //Destructor
void Print(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board void Print(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board
void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board using colour void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH, bool showRevealed=true); //Print board using colour
#ifdef BUILD_GRAPHICS #ifdef BUILD_GRAPHICS
void Draw(const Piece::Colour & reveal=Piece::BOTH, bool showRevealed = true); //Draw board void Draw(const Piece::Colour & reveal=Piece::BOTH, bool showRevealed = true); //Draw board
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment