示例#1
0
        private void Update(EvaluationContext context)
        {
            if (!_initialized || TriggerReset.GetValue(context))
            {
                Result.Value = DefaultValue.GetValue(context);
                _initialized = true;
            }

            var triggered = Running.GetValue(context);

            if (OnlyCountChanges.GetValue(context) && triggered == _lastTrigger)
            {
                return;
            }

            _lastTrigger = triggered;

            if (triggered)
            {
                Result.Value += Increment.GetValue(context);
            }

            var modulo = Modulo.GetValue(context);

            if (modulo != 0)
            {
                Result.Value %= modulo;
            }
        }