Browse Source

Add Param::randomizable

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
5de5db2a18
2 changed files with 4 additions and 1 deletions
  1. +2
    -0
      include/engine/Param.hpp
  2. +2
    -1
      src/engine/Module.cpp

+ 2
- 0
include/engine/Param.hpp View File

@@ -38,6 +38,8 @@ struct Param {
/** An optional one-sentence description of the parameter */
std::string description;
ParamQuantityFactory *paramQuantityFactory = NULL;
/** Determines whether this param will be randomized automatically when the user requests to randomize the module state */
bool randomizable = true;

~Param() {
if (paramQuantityFactory)


+ 2
- 1
src/engine/Module.cpp View File

@@ -81,7 +81,8 @@ void Module::reset() {

void Module::randomize() {
for (Param &param : params) {
param.randomize();
if (param.randomizable)
param.randomize();
}
onRandomize();
}


Loading…
Cancel
Save