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

Method randomizeCountdowns

source/EngineInterface/DescriptionEditService.cpp:478–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478void DescriptionEditService::randomizeCountdowns(ClusteredDataDescription& data, int minValue, int maxValue)
479{
480 for (auto& cluster : data.clusters) {
481 auto countdown = NumberGenerator::get().getRandomReal(toDouble(minValue), toDouble(maxValue));
482 for (auto& cell : cluster.cells) {
483 if (cell.getCellFunctionType() == CellFunction_Detonator) {
484 std::get<DetonatorDescription>(*cell.cellFunction).countdown = countdown;
485 }
486 }
487 }
488}
489
490void DescriptionEditService::randomizeMutationIds(ClusteredDataDescription& data)
491{

Callers 1

onExecuteMethod · 0.80

Calls 3

toDoubleFunction · 0.85
getRandomRealMethod · 0.80
getCellFunctionTypeMethod · 0.45

Tested by

no test coverage detected