(color)
| 299 | } |
| 300 | |
| 301 | addAgent(color) { |
| 302 | this.setState({ |
| 303 | numAgents: this.state.numAgents + 1, |
| 304 | agents: [ |
| 305 | ...this.state.agents, |
| 306 | { |
| 307 | SR: this.state.addedSRow, |
| 308 | SC: this.state.addedSCol, |
| 309 | GR: this.state.addedGRow, |
| 310 | GC: this.state.addedGCol, |
| 311 | color: color, |
| 312 | }, |
| 313 | ], |
| 314 | }); |
| 315 | } |
| 316 | |
| 317 | showSnackbar(color) { |
| 318 | if (!this.state.isError) this.addAgent(color); |