예제 #1
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(propertyKey.Value))
            {
                LogError("Property Key name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            ParseQuery <ParseObject> _query = PlayMakerParseProxy.GetParseObjectQuery(queryId.Value);

            if (_query == null)
            {
                LogError("retrieving query failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (where == ParseComparisonClauses.EqualTo)
            {
                _query = _query.WhereEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.NotEqualTo)
            {
                _query = _query.WhereNotEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.LessThan)
            {
                _query = _query.WhereLessThan(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.LessThanOrEqualTo)
            {
                _query = _query.WhereLessThanOrEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.GreaterThan)
            {
                _query = _query.WhereGreaterThan(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }
            else if (where == ParseComparisonClauses.GreaterThanOrEqualTo)
            {
                _query = _query.WhereGreaterThanOrEqualTo(propertyKey.Value, PlayMakerParseProxy.GetParseValueFromFsmVar(this.Fsm, propertyValue));
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }