Esempio n. 1
0
        /// <include file='.\ISyncService.xml' path='/SyncService/GetDirectoryListing/*'/>
        public IEnumerable <FileStatistics> GetDirectoryListing(string remotePath)
        {
            Collection <FileStatistics> value = new Collection <FileStatistics>();

            // create the stat request message.
            this.Socket.SendSyncRequest(SyncCommand.LIST, remotePath);

            while (true)
            {
                var dent = new Dent();
                dent.ReadFrom(this.Socket);

                if (dent.Command == SyncCommand.DONE)
                {
                    break;
                }
                else if (dent.Command != SyncCommand.DENT)
                {
                    throw new AdbException($"The server returned an invalid sync response.");
                }

                FileStatistics entry = FileStatistics.ReadFromDent(dent);
                value.Add(entry);
            }

            return(value);
        }
Esempio n. 2
0
 public static FileStatistics ReadFromDent(Dent dent)
 {
     return(new FileStatistics()
     {
         FileMode = dent.FileMode,
         Size = dent.Size,
         Time = dent.Time,
         Path = dent.Path,
     });
 }
Esempio n. 3
0
    public void SwitchDent(EmplacementDent empTarget)
    {
        empTarget.Unselect();
        Dent temp = empTarget.GetDent();

        empTarget.SetDent(dent);
        dent.SetEmp(empTarget);
        SetDent(temp);
        if (temp != null)
        {
            temp.SetEmp(this);
        }
    }
Esempio n. 4
0
    public void Crank()
    {
        if (wait == 0 && !pause)
        {
            if (model.IsBeginning())
            {
                if (!end)
                {
                    Dent.SetMove(false);
                    if (autoMode)
                    {
                        view.SetMove(false);
                    }
                }
                isPlaying = true;
            }
            else if (model.IsLimitPoint() && !end)
            {
                if (!GameManager.Instance().Proceed(p_controller.GetDents()))
                {
                    StartCoroutine(waitForError());
                    ResetCrank();
                    return;
                }
            }

            model.Crank();
            view.UpdateView(model.GetState());
            p_controller.Read();

            if (!end)
            {
                illustration.Read();
            }

            if (model.IsBeginning())
            {
                isPlaying = false;
                GameManager.Instance().NextLevel();
                Dent.SetMove(true);
                auto = false;
                if (autoMode)
                {
                    view.SetMove(true);
                }
            }

            wait = waitingTime;
        }
    }
Esempio n. 5
0
    public void ReverseCrank()
    {
        if (wait == 0 && !pause)
        {
            if (model.IsBeginning() && !end)
            {
                if (!final || end)
                {
                    return;
                }
            }

            model.ReverseCrank();
            view.UpdateView(model.GetState());
            p_controller.ReverseRead();

            if (!end)
            {
                if (!final)
                {
                    illustration.ReverseRead();
                }
                else
                {
                    illustration.FastReverseRead();
                }
            }

            if (model.IsBeginning())
            {
                if (!final || end)
                {
                    isPlaying = false;
                    Dent.SetMove(true);
                    view.SetMove(true);
                    reset = false;
                    auto  = false;
                }
                else if (!end && final_img != 0)
                {
                    --final_img;
                }
            }

            wait = waitingTime;
        }
    }
Esempio n. 6
0
    private void Update()
    {
        if (wait > 0)
        {
            --wait;
        }
        if (wait < 0)
        {
            wait = 0;
        }

        if (reset)
        {
            ReverseCrank();
        }
        else if (autoMode && auto)
        {
            Crank();
        }
        else if (!final && GameManager.Instance().IsEnd())
        {
            final = true;
            Dent.SetMove(false);
            view.SetMove(false);
        }
        else if (final && wait_final != 0)
        {
            --wait_final;
        }
        else if (final && final_img != 0 && !end)
        {
            ReverseCrank();
        }
        else if (!end && final_img == 0)
        {
            end = true;
            Dent.SetMove(true);
            view.SetMove(true);
            animator.SetTrigger("End");
            auto_button.gameObject.SetActive(true);
        }
    }
Esempio n. 7
0
    public void NextLevel()
    {
        if (currentLevel < nbLevels - 1)
        {
            Dent            newDent = dents[currentLevel];
            EmplacementDent newEmp  = emps[currentLevel];
            GameObject      placebo = placebos[currentLevel];

            newDent.gameObject.SetActive(true);
            newEmp.gameObject.SetActive(true);
            placebo.SetActive(false);
            animator.SetTrigger("NewDent");
            source.PlayOneShot(getDent, 1);

            ++currentLevel;
        }
        else
        {
            end = true;
        }
    }
Esempio n. 8
0
 public void SetDent(Dent dent)
 {
     this.dent = dent;
 }