* Add some pretty printers to help debugging.
This commit is contained in:
jean.chalard
2009-09-04 13:22:15 +00:00
parent 2a7d6819bb
commit 2e7570fdea
15 changed files with 71 additions and 20 deletions

View File

@@ -28,7 +28,7 @@ Player::~Player(){
SAFE_DELETE(mAvatar);
}
const string Player::getDisplayName(){
const string Player::getDisplayName() const {
GameObserver * g = GameObserver::GetInstance();
if (this == g->players[0]) return "Player 1";
return "Player 2";
@@ -75,3 +75,8 @@ void Player::cleanupPhase(){
game->inPlay->cleanupPhase();
game->graveyard->cleanupPhase();
}
ostream& operator<<(ostream& out, const Player& p)
{
return out << p.getDisplayName();
}