#include "BoardLayout.h" #include #include #include BoardLayout::BoardLayout() { filename=""; clearBoardLayout(); } BoardLayout::~BoardLayout() { } void BoardLayout::clearBoardLayout() { loadedBoard=""; initialiseBoard(); } bool BoardLayout::saveBoardLayout(const TQString where) { TQFile f(where); if (!f.open(IO_ReadWrite)) { return false; } TQCString tmp = layoutMagic1_0.utf8(); if (f.writeBlock(tmp, tmp.length()) == -1) { return(false); } for (int z=0; z0; x--) { board[z][y][x] = board[z][y][x-1]; } board[z][y][0] = 0; } } } void BoardLayout::shiftUp() { for (int z=0; z0; y--) { for (int x=0; x= depth -1) return false; if( board[z+1][y][x] || board[z+1][y+1][x] || board[z+1][y][x+1] || board[z+1][y+1][x+1] ) { return true; } return false; } bool BoardLayout::blockedLeftOrRight(short z, short y, short x) { return( (board[z][y][x-1] || board[z][y+1][x-1]) && (board[z][y][x+2] || board[z][y+1][x+2]) ); } void BoardLayout::deleteTile(POSITION &p) { if ( p.e