(color)
| 312 | } |
| 313 | |
| 314 | addAgent(color) { |
| 315 | this.setState({ |
| 316 | numAgents: this.state.numAgents + 1, |
| 317 | agents: [ |
| 318 | ...this.state.agents, |
| 319 | { |
| 320 | SR: this.state.addedSRow, |
| 321 | SC: this.state.addedSCol, |
| 322 | GR: this.state.addedGRow, |
| 323 | GC: this.state.addedGCol, |
| 324 | height: this.state.addedHeight, |
| 325 | width: this.state.addedWidth, |
| 326 | color: color, |
| 327 | }, |
| 328 | ], |
| 329 | }); |
| 330 | } |
| 331 | |
| 332 | showSnackbar(color) { |
| 333 | if (!this.state.isError) this.addAgent(color); |