From fc6762949463f696aaf90fd7a0caf01120e13e49 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 20 Mar 2008 23:04:12 +0100 Subject: [PATCH] . --- src/core/piece.cpp | 13 +++++++++++-- src/core/type.cpp | 6 +++++- src/variants/shogi/types/bishop.cpp | 1 + src/variants/shogi/types/dragonhorse.cpp | 3 +++ src/variants/shogi/types/king.cpp | 3 +++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/core/piece.cpp b/src/core/piece.cpp index 84a4841..51fcb6a 100644 --- a/src/core/piece.cpp +++ b/src/core/piece.cpp @@ -10,14 +10,23 @@ #include "piece.h" +#include "type.h" +#include + Piece::Piece(const IColor* color, const IType* type) : m_type(type) -, m_color(color) { } +, m_color(color) { + if (type) + kDebug() << "Piece::Piece with type" << type << type->name(); +} const IColor* Piece::color() const { return m_color; } const IType* Piece::type() const { return m_type; } -void Piece::setType(const IType* type) { m_type = type; } +void Piece::setType(const IType* type) { + kDebug() << "Piece::setType" << type; + m_type = type; +} bool Piece::operator==(const Piece& piece) const { return m_type == piece.type() && diff --git a/src/core/type.cpp b/src/core/type.cpp index c8f51e4..6c05784 100644 --- a/src/core/type.cpp +++ b/src/core/type.cpp @@ -10,5 +10,9 @@ #include "type.h" -IType::~IType() { } +#include + +IType::~IType() { + kDebug() << "~IType" << this; +} diff --git a/src/variants/shogi/types/bishop.cpp b/src/variants/shogi/types/bishop.cpp index c893570..15b676d 100644 --- a/src/variants/shogi/types/bishop.cpp +++ b/src/variants/shogi/types/bishop.cpp @@ -26,6 +26,7 @@ Bishop::Bishop() { { 1, -1, 0 }, }; + kDebug() << (IType*)this; for (unsigned i = 0; i < sizeof(movesDefinition)/sizeof(movesDefinition[0]); i++) m_moveDefinitions.push_back(movesDefinition[i]); } diff --git a/src/variants/shogi/types/dragonhorse.cpp b/src/variants/shogi/types/dragonhorse.cpp index 0640ab3..133442f 100644 --- a/src/variants/shogi/types/dragonhorse.cpp +++ b/src/variants/shogi/types/dragonhorse.cpp @@ -10,6 +10,8 @@ #include "dragonhorse.h" +#include + namespace Shogi { DragonHorse::DragonHorse() { @@ -24,6 +26,7 @@ DragonHorse::DragonHorse() { { 1, -1, 0 }, }; + kDebug() << (IType*)this; for (unsigned i = 0; i < sizeof(movesDefinition)/sizeof(movesDefinition[0]); i++) m_moveDefinitions.push_back(movesDefinition[i]); } diff --git a/src/variants/shogi/types/king.cpp b/src/variants/shogi/types/king.cpp index a13ed6e..f40f7df 100644 --- a/src/variants/shogi/types/king.cpp +++ b/src/variants/shogi/types/king.cpp @@ -10,6 +10,8 @@ #include "king.h" +#include + namespace Shogi { King::King() { @@ -24,6 +26,7 @@ King::King() { { 1, -1, 1 }, }; + kDebug() << (IType*)this; for (unsigned i = 0; i < sizeof(movesDefinition)/sizeof(movesDefinition[0]); i++) m_moveDefinitions.push_back(movesDefinition[i]); } -- 2.11.4.GIT