resolveGameValues function

Map<String, dynamic> resolveGameValues(
  1. Map<String, dynamic> values,
  2. VariableScope scope
)

Resolves {{ }} tokens in the marketer's text before it reaches the skin, so init.values and init.slots[].values carry finished text.

Every string leaf is resolved, nested maps and lists included; every other value passes through unchanged.

Implementation

Map<String, dynamic> resolveGameValues(
  Map<String, dynamic> values,
  VariableScope scope,
) =>
    {
      for (final entry in values.entries)
        entry.key: _resolveValue(entry.value, scope),
    };