AddVCButtonMatrix::~AddVCButtonMatrix() { QSettings settings; settings.setValue(HORIZONTAL_COUNT, horizontalCount()); settings.setValue(VERTICAL_COUNT, verticalCount()); settings.setValue(BUTTON_SIZE, buttonSize()); }
int GobangGame::judge() const { int row = (int)(_history[_steps-1] >> 8); int col = (int)(_history[_steps-1] & 0xff); int who = _map[row*_gridLength + col]; if ((horizonalCount(row, col, who) & 0xffffff) >= 4 || (verticalCount(row, col, who) & 0xffffff) >= 4 || (slantCount(row, col, who) & 0xffffff) >= 4 || (backSlantCount(row, col, who) & 0xffffff) >= 4) return who; if (_steps == _gridLength * _gridLength) return -1; return -2; }
void AddVCButtonMatrix::setAllocationText() { QString text("%1 / %2"); m_allocationEdit->setText(text.arg(m_tree->topLevelItemCount()) .arg(horizontalCount() * verticalCount())); }