示例#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 == ParseExistsClauses.Exists)
            {
                _query = _query.WhereExists(propertyKey.Value);
            }
            else if (where == ParseExistsClauses.DoesNotExist)
            {
                _query = _query.WhereDoesNotExist(propertyKey.Value);
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }
示例#2
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(orderBy.Value))
            {
                LogError("orderBy Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (!thenBy.IsNone && !PlayMakerParseProxy.IsPropertyKeyValid(thenBy.Value))
            {
                LogError("thenBy Class 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 (descending.Value)
            {
                _query = _query.OrderBy(orderBy.Value);
            }
            else
            {
                _query = _query.OrderByDescending(orderBy.Value);
            }

            if (!thenBy.IsNone)
            {
                if (thenByDescending.Value)
                {
                    _query = _query.ThenBy(thenBy.Value);
                }
                else
                {
                    _query = _query.ThenByDescending(thenBy.Value);
                }
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            Fsm.Event(successEvent);
            Finish();
        }
示例#3
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();
        }
示例#4
0
        public override void OnEnter()
        {
            if (!PlayMakerParseProxy.IsPropertyKeyValid(className.Value))
            {
                LogError("Class name invalid");
                Fsm.Event(errorEvent);
                Finish();
            }


            ParseQuery <ParseObject> _query = ParseObject.GetQuery(className.Value);

            if (_query == null)
            {
                LogError("Set parse property failed");
                Fsm.Event(errorEvent);
                Finish();
            }

            if (!limit.IsNone)
            {
                _query = _query.Limit(limit.Value);
            }

            if (!string.IsNullOrEmpty(include.Value))
            {
                _query = _query.Include(include.Value);
            }


            bool ok = PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

            if (!ok)
            {
                LogError("Parse Query could not be cached");
                Fsm.Event(errorEvent);
                Finish();
            }

            Fsm.Event(successEvent);
            Finish();
        }
示例#5
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 == ParseStringMatchClauses.Contains)
            {
                _query = _query.WhereContains(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.StartsWith)
            {
                _query = _query.WhereStartsWith(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.EndsWith)
            {
                _query = _query.WhereEndsWith(propertyKey.Value, propertyValue.Value);
            }
            else if (where == ParseStringMatchClauses.Matches)
            {
                _query = _query.WhereMatches(propertyKey.Value, propertyValue.Value, null);
            }

            PlayMakerParseProxy.CacheParseObjectQuery(queryId.Value, _query);

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