From 8cacfa0160961a79d7d12ddd1b547ce990acdaa9 Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Tue, 14 Aug 2007 12:24:48 +0200 Subject: [PATCH] Removed all promotion stuff from controllers and UI. --- src/controllers/abstract.cpp | 16 ---------------- src/controllers/abstract.h | 15 --------------- src/controllers/editgame.cpp | 4 ---- src/controllers/editgame.h | 1 - src/ui.cpp | 12 ------------ src/ui.h | 9 +-------- 6 files changed, 1 insertion(+), 56 deletions(-) diff --git a/src/controllers/abstract.cpp b/src/controllers/abstract.cpp index 9373216..dabfd90 100644 --- a/src/controllers/abstract.cpp +++ b/src/controllers/abstract.cpp @@ -36,22 +36,6 @@ bool Controller::promoteVariation() { return entity()->promoteVariation(); } -void Controller::setPromotionType(int p) { - entity()->changePromotionType(p); -} - -int Controller::promotionType() const { - return entity()->promotionType(); -} - -bool Controller::doPromotion() const { - return entity()->promotionType() >= 0; -} - -void Controller::setDoPromotion(bool value) { - return entity()->changePromotionType(value ? 0 : -1); -} - bool Controller::back() { return entity()->back(); } diff --git a/src/controllers/abstract.h b/src/controllers/abstract.h index 61b49bf..bc97701 100644 --- a/src/controllers/abstract.h +++ b/src/controllers/abstract.h @@ -93,21 +93,6 @@ public: virtual PositionPtr currentPosition() const { return PositionPtr(); } /** - * Set autopromotion type. In chess and variants with promotions, - * all pawns will be automatically promoted to @a type. - */ - virtual void setPromotionType(int); - - /** - * Retrieve current promotion type. - * @sa setPromotionType. - */ - virtual int promotionType() const; - - virtual void setDoPromotion(bool); - virtual bool doPromotion() const; - - /** * Change turn. Used for example in edit position mode. */ virtual void setTurn(int) { } diff --git a/src/controllers/editgame.cpp b/src/controllers/editgame.cpp index e1e02ac..82388ea 100644 --- a/src/controllers/editgame.cpp +++ b/src/controllers/editgame.cpp @@ -133,10 +133,6 @@ QString EditGameController::variant() const { return QString(); } -void EditGameController::setPromotionType(int type) { - m_entity->changePromotionType(type); -} - void EditGameController::onNavigation() { } EntityToken EditGameController::addPlayingEngine(int side, const shared_ptr& engine) { diff --git a/src/controllers/editgame.h b/src/controllers/editgame.h index 836fe69..3567665 100644 --- a/src/controllers/editgame.h +++ b/src/controllers/editgame.h @@ -54,7 +54,6 @@ public: EditGameController(ChessTable*, const VariantPtr& variant, AbstractPosition::Ptr startingPos = AbstractPosition::Ptr()); ~EditGameController(); - virtual void setPromotionType(int); virtual QString variant() const; EntityToken addPlayingEngine(int side, const boost::shared_ptr& engine); diff --git a/src/ui.cpp b/src/ui.cpp index 7b3a65d..8b06e5b 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -101,18 +101,6 @@ void UI::pgnPaste(const QString&) { //controller()->loadPGN(pgn); } -int UI::promotionType() const { - return controller()->promotionType(); -} - -bool UI::doPromotion() const { - return controller()->doPromotion(); -} - -void UI::setDoPromotion(bool value) { - controller()->setDoPromotion(value); -} - void UI::clearBoard() { controller()->clearBoard(); } diff --git a/src/ui.h b/src/ui.h index fb1a4b2..3c340b9 100644 --- a/src/ui.h +++ b/src/ui.h @@ -53,14 +53,7 @@ public Q_SLOTS: void pgnCopy(); void pgnPaste(); void pgnPaste(const QString&); - - // promotion type - int promotionType() const; - - // do promotion - void setDoPromotion(bool); - bool doPromotion() const; - + // editing void clearBoard(); void setStartingPosition(); -- 2.11.4.GIT