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

Method handleAddAgentByClick

src/MAPFVisualizer.jsx:282–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280 }
281
282 handleAddAgentByClick() {
283 const color = randomColor({ luminosity: "light", alpha: 0.5 });
284 while (this.state.usedColors.has(color)) {
285 color = randomColor({ luminosity: "light" });
286 }
287 this.setState({ usedColors: this.state.usedColors.add(color) });
288 this.setState({ startToAdd: true, colorToAdd: color });
289 }
290
291 addAgent(color) {
292 this.setState({

Callers 1

renderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected