Example #1
0
    private void Awake()
    {
        _parseClient = ParseClientGO.GetComponent <IParseClient>();
        _navigation  = NavigationGO.GetComponent <INavigation>();

        Difficulty = 1;
    }
Example #2
0
        /// <summary>
        ///  Writes any pending operation to the database
        /// </summary>
        /// <param name="database"></param>
        /// <param name="isReadOnly"></param>
        public void FlushUpdateToDatabase(IParseClient database, bool isReadOnly = false)
        {
            // ENHANCE: I suppose if desired, we could try to re-read the row in the database and make sure we compare against the most recent veresion.
            // Dunno if that makes life any better when 2 sources are trying to update it.
            // Maybe the best thing to do is to re-read the row, check if it's the same as our current one, and abort the processing if we don't have the right version?

            var pendingUpdates = this.GetPendingUpdates();

            if (!pendingUpdates._updatedFieldValues.Any())
            {
                return;
            }

            var pendingUpdatesJson = pendingUpdates.ToJson();

            if (isReadOnly)
            {
                Console.Out.WriteLine("SKIPPING WRITE BECAUSE READ ONLY: " + pendingUpdatesJson);
            }
            else
            {
                database.UpdateObject(this.GetParseClassName(), this.ObjectId, pendingUpdatesJson);
            }

            MarkAsDatabaseVersion();
        }
 public RepositoryVisitor(Repository repo, IParseClient visitor)
 {
     this.repo    = repo;
     this.visitor = visitor;
     index        = new Dictionary <object, int>();
     foreach (object element in repo.GetElements())
     {
         index.Add(element, index.Count + 1);
     }
 }
Example #4
0
 private void Awake()
 {
     _parseClient  = ParseClientGO.GetComponent <IParseClient>();
     _navigation   = NavigationGO.GetComponent <INavigation>();
     _avatarClient = AvatarClientGO.GetComponent <IAvatarClient>();
     if (_playerConfig.AvatarUrl == null)
     {
         SetAvatar("");
     }
     else
     {
         SetAvatar(_playerConfig.AvatarUrl);
     }
 }
Example #5
0
    private void Awake()
    {
        _parseClient = ParseClientGO.GetComponent <IParseClient>();
        _uniWebView  = UniWebViewGO.GetComponent <UniWebView>();
        _navigation  = NavigationGO.GetComponent <INavigation>();


        _playerConfig.Reset();
        UniWebViewLogger.Instance.LogLevel = UniWebViewLogger.Level.Verbose;
        UniWebView.ClearCookies();

        _parseClient.SetSessionToken(_config.SessionToken);
        _uniWebView.OnMessageReceived += (webView, message) =>
        {
            _config.SessionToken = message.Args["token"];
            _uniWebView.Hide();
            _parseClient.SetSessionToken(_config.SessionToken);
            CheckSession();
        };
    }
 internal Importer(string serviceAccountKeyJsonPath)
 {
     _parseClient    = new ParseExporterReader();
     _firebaseClient = new FirebaseClient(serviceAccountKeyJsonPath);
 }
Example #7
0
 private void Awake()
 {
     _parseClient  = ParseClientGO.GetComponent <IParseClient>();
     _navigation   = NavigationGO.GetComponent <INavigation>();
     _avatarClient = AvatarClientGO.GetComponent <IAvatarClient>();
 }
Example #8
0
        public void Accept(IParseClient visitor)
        {
            RepositoryVisitor rv = new RepositoryVisitor(this, visitor);

            rv.Run();
        }