Skip to content

Commit

Permalink
cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
shdq committed Mar 12, 2019
1 parent b9c3eb3 commit 82ed74b
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,33 +208,11 @@ class App extends Component {
restarted: 0
};

console.log(this.state.field);

// this.handleMouseDown = this.handleMouseDown.bind(this);
// this.handleMouseUp = this.handleMouseUp.bind(this);
this.handleLeftClick = this.handleLeftClick.bind(this);
this.openMines = this.openMines.bind(this);
this.restartGame = this.restartGame.bind(this);
}

// handleMouseDown() {
// if (this.state.mood === "😎" || this.state.mood === "😡") {
// return;
// }
// this.setState({
// mood: "😰"
// });
// }

// handleMouseUp() {
// if (this.state.mood === "😎" || this.state.mood === "😡") {
// return;
// }
// this.setState({
// mood: "πŸ™‚"
// });
// }

openMines() {
const opened = this.state.isOpened;
for (let i = 0; i < this.state.field.width * this.state.field.height; i++) {
Expand All @@ -257,7 +235,6 @@ class App extends Component {
return;
}

console.log(cell);
const opened = this.state.isOpened;
opened.add(cell.index);
this.setState({
Expand All @@ -267,7 +244,6 @@ class App extends Component {
if (cell.value === "πŸ’£" && this.state.mood !== "😎") {
const f = this.state.field;
f.data[cell.index] = "πŸ’₯";

this.setState({ mood: "😡", field: f, isOpened: this.openMines() });
}

Expand Down Expand Up @@ -307,7 +283,6 @@ class App extends Component {
return;
}

console.log(cell);
const flagged = this.state.isFlagged;
if (flagged.has(cell.index)) {
flagged.delete(cell.index);
Expand Down Expand Up @@ -360,13 +335,7 @@ class App extends Component {
<Mood onClick={this.restartGame}>{this.state.mood}</Mood>
<Count flagged={this.state.field.mines - this.state.isFlagged.size} />
</Panel>
<Wrapper
// onMouseUp={this.handleMouseUp}
// onMouseDown={this.handleMouseDown}
width={this.state.field.width}
>
{this.grid}
</Wrapper>
<Wrapper width={this.state.field.width}>{this.grid}</Wrapper>
</React.Fragment>
);
}
Expand Down

0 comments on commit 82ed74b

Please sign in to comment.