Computes a concrete value, if a template value is passed.
Otherwise the original value is returned.
Templates are:
-
An array with at least two elements
whose first element is
"@some".
For such an array some of its other elements
is returned randomly.
-
An object that contains two special attributes
named
"@min" and "@max".
The values of those attributes have to be numbers.
Returned is a random value within the interval
defined by "@min" and "@max".
There are further attributes that affect the computation
of the random value:
"@integer": true/false:
If true, an integer value is computed within the interval
[@min, @max]. If false, a float value is computed
within the interval [@min, @max[.
"@positive": value:
The value has to be a number greater or equal 0 and less or equal 1.
The randomly computed number is with a probability of
value a member of [@min, @max] or [@min, @max[ resp.
and with a probability of 1-value
a member of [-@max, -@min] or [-@max, -@min[.
"@relative": "name" (a string value):
The computed value is multiplied with the environment value
p_environment[name], if that value exists.
{"@stringToHeX": "#AFFE00"}:
A three or six byte color key is converted into the corresponding
integer code of that color. This is needed by PixiJS, as that library
can only deal with integer color codes instead of string color codes.
Hex values, such as 0xAFFE00, which are accepted by PixiJS,
on the other hand, cannot be stored in JSON-Files ....
"@@NAME":
Two @-symbols at the beginning of a key name (including
"@@some") are replace by one. So, those keys are
not concretized by the first invocation of this function
but by the second. If the key name starts with more then
two @-symbols, concretize must applied correspondingly often to
concretize the value associated.