MCPcopy Create free account
hub / github.com/chrxh/alien / randomizeCellColors

Method randomizeCellColors

source/EngineInterface/DescriptionEditService.cpp:421–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void DescriptionEditService::randomizeCellColors(ClusteredDataDescription& data, std::vector<int> const& colorCodes)
422{
423 for (auto& cluster : data.clusters) {
424 auto newColor = colorCodes[NumberGenerator::get().getRandomInt(toInt(colorCodes.size()))];
425 for (auto& cell : cluster.cells) {
426 cell.color = newColor;
427 }
428 }
429}
430
431namespace
432{

Callers 1

onExecuteMethod · 0.80

Calls 3

toIntFunction · 0.85
getRandomIntMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected