MCPcopy Create free account
hub / github.com/StevenLyt/mapf-visualizer / handleAddAgent

Method handleAddAgent

src/LAMAPFVisualizer.jsx:296–312  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

294 }
295
296 handleAddAgent(e) {
297 e.preventDefault();
298 const error =
299 this.state.addedSRow >= this.state.numRow ||
300 this.state.addedSRow < 0 ||
301 this.state.addedSCol >= this.state.numCol ||
302 this.state.addedSCol < 0 ||
303 this.state.addedGRow >= this.state.numRow ||
304 this.state.addedGRow < 0 ||
305 this.state.addedGCol >= this.state.numCol ||
306 this.state.addedGCol < 0 ||
307 this.checkRowOOR() ||
308 this.checkColOOR();
309 if (error) return;
310
311 this.addAgentToMap();
312 }
313
314 addAgent(color) {
315 this.setState({

Callers

nothing calls this directly

Calls 3

checkRowOORMethod · 0.95
checkColOORMethod · 0.95
addAgentToMapMethod · 0.95

Tested by

no test coverage detected