예제 #1
0
        public override void CheckState(FrameOperationContext fop, PedometerCondition condition, ConditionCheckStateComplete onComplete)
        {
            bool  res = false;
            float spm = PedometerCalculator.Instance.StepsPerMinute;

            if (condition.StepsPerMinuteRange != null)
            {
                res = condition.StepsPerMinuteRange.IsInRange(spm);
            }

            onComplete(res, null);
        }
예제 #2
0
        public override void CheckState(FrameOperationContext fop, InventoryCondition condition, ConditionCheckStateComplete onComplete)
        {
            // Get the current count of the item in the inventory
            var count = Inventory.Instance.GetCount(condition.CollectibleCount.CollectibleId);

            // Use MathHelper to compare this count with the count in the condition, given the
            // numerical condition operator
            var result = MathHelper.CheckNumericalCondition(condition.Operator, count, condition.CollectibleCount.Count);

            // Report back whether or not this condition is met
            onComplete(result, null);
        }