Ejemplo n.º 1
0
        /// <summary>
        /// This function should only be used to reprocess a StageComplete message after loading a saved document
        /// </summary>
        /// <param name="message"></param>
        public void terminateStage(TurKitSocKit.TurKitStageComplete message)
        {
            //totalRequested[message.paragraph] = new List<int>();
            while (totalRequested.Count < message.paragraph + 1)
            {
                totalRequested.Add(new List <int>());
            }
            while (totalRequested[message.paragraph].Count < message.patchNumber + 1)
            {
                totalRequested[message.paragraph].Add(0);
            }
            totalRequested[message.paragraph][message.patchNumber] = message.totalRequested;

            /*
             * done[message.paragraph] = new List<bool>();
             * done[message.paragraph].Add(true);
             */

            while (numCompletedperParagraph.Count < message.paragraph + 1)
            {
                numCompletedperParagraph.Add(new List <int>());
            }
            while (numCompletedperParagraph[message.paragraph].Count < message.patchNumber + 1)
            {
                numCompletedperParagraph[message.paragraph].Add(0);
            }
            numCompletedperParagraph[message.paragraph][message.patchNumber] = message.totalRequested;

            moneySpent = message.payment * numCompleted;

            if (listener != null)
            {
                listener.notify();
            }
        }
Ejemplo n.º 2
0
        public void terminateStage(TurKitSocKit.TurKitStageComplete donezo)
        {
            StageData stage = null;

            if (donezo.stage == "find")
            {
                stage = findStageData;
            }
            else if (donezo.stage == "fix")
            {
                stage = fixStageData;
            }
            else if (donezo.stage == "verify")
            {
                stage = verifyStageData;
            }

            stage.terminateStage(donezo);
            (view as ShortnView).updateView();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Process a StageComplete message from TurKit
        /// </summary>
        /// <param name="donezo"></param>
        public void stageCompleted(TurKitSocKit.TurKitStageComplete donezo)
        {
            stageCompletes.Add(donezo);

            StageData stage = null;

            if (donezo.stage == "find")
            {
                stage = findStageData;
            }
            else if (donezo.stage == "fix")
            {
                stage = fixStageData;
            }
            else if (donezo.stage == "verify")
            {
                stage = verifyStageData;
            }

            stage.terminatePatch(donezo.paragraph, donezo.patchNumber);
        }