#include "board.h" #include "board.moc" #include "common/misc_ui.h" #include "common/factory.h" #include "piece.h" using namespace KGrid2D; KSBoard::KSBoard(bool graphic, TQWidget *parent) : Board(graphic, new GiftPool(parent), parent), filled(matrix().height()), linesRemoved(4) { init(); } void KSBoard::init() { addRemoved = 0; _lastRemoved = 0; for (uint i=0; i<4; i++) { linesRemoved[i] = 0; _lastRemoved += 2<(g).filled.copy(); // deep copy } void KSBoard::start(const GTInitData &data) { init(); Board::start(data); } void KSBoard::computeInfos() { Board::computeInfos(); filled.fill(0); for (uint j=0; j1 ? addRemoved-1 : 0); addRemoved = 0; return g; } void KSBoard::setGarbageBlock(const Coord &c) { Block *gb = currentPiece()->garbageBlock(); gb->sprite()->show(); setBlock(c, gb); } bool KSBoard::_putGift(uint nb) { if ( nbClearLines()==0 ) return false; // lift all the cases of one line // (nbClearLine!=0 --> firstClearLine!=height for (uint j=firstClearLine(); j>0; j--) for (uint i=0; icbi.baseTime / (1 + stageData().speed); } void KSBoard::arcadePrepare() { if ( !stageData().hasPattern ) return; for (uint i=0; iupdate(); }