Skip to content

Commit

Permalink
簡化流程
Browse files Browse the repository at this point in the history
  • Loading branch information
jeang-bo-yuan committed Apr 26, 2023
1 parent 3de9519 commit 5acbf54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions minesweeper/CmdGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ int startCmdGame() {
GameBoard board;

while(1) {
board.unload();

standby(board);
playing(board);
int need_restart = ending(board);

if (need_restart)
continue;
board.unload();
else
break;
}
Expand Down
4 changes: 2 additions & 2 deletions minesweeper/MineButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ void MineButton::mouseReleaseEvent(QMouseEvent* event) {
}

void MineButton::setText(char txt) {
QPushButton::setText(QString(txt == (char)GameBoard::Mask::closed ? '\0' : txt));
QPushButton::setText(QString(txt));

switch (txt) {
case (char)GameBoard::Mask::closed:
setStyleSheet(BORDER "background-color: grey");
setStyleSheet(BORDER "color: grey;" "background-color: grey");
break;
case (char)GameBoard::Mask::flag:
setStyleSheet(BORDER "background-color: blue");
Expand Down

0 comments on commit 5acbf54

Please sign in to comment.