Exemple #1
0
        public void trackCompleted(Completable c)
        {
            float score = Mathf.Max(Mathf.Min(c.getScore().getScore() / 10f, 1f), 0f);

            Tracker.T.setVar("time", (DateTime.Now - times[c]).TotalSeconds);
            Tracker.T.completable.Completed(c.getId(), (CompletableTracker.Completable)c.getType(), true, score);
        }
        public override int countIdentifierReferences(string id)
        {
            int occurrences = 0;

            if (id.Equals(completable.getId(), StringComparison.InvariantCultureIgnoreCase))
            {
                ++occurrences;
            }
            return(startDataControl.countIdentifierReferences(id) + endDataControl.countIdentifierReferences(id) + progressDataControl.countIdentifierReferences(id) + occurrences);
        }
Exemple #3
0
        public void targetChanged(IChapterTarget target)
        {
            //Complete if any scene is completed on exit.
            if (completeOnExit != null)
            {
                Tracker.T.completable.Completed(completeOnExit.getId(), CompletableTracker.Completable.Stage, true, completeOnExit.getScore().getScore());
                completeOnExit = null;
            }

            //Buscamos en nuestra lista de completables si algun completable se completa o progresa al llegar aquí
            foreach (Completable toComplete in completables)
            {
                if (toComplete.getProgress().updateMilestones(target))
                {
                    Tracker.T.completable.Progressed(toComplete.getId(), (CompletableTracker.Completable)toComplete.getType(), toComplete.currentProgress());
                }

                if (toComplete.getEnd().Update(target))
                {
                    trackCompleted(toComplete);
                    toRemove.Push(toComplete);
                }
            }

            clearToRemove();

            //Buscamos en nuestros completables si alguno se inicia con esta escena
            foreach (Completable completable in completables)
            {
                // TODO:
                // prevent levels overlaping.

                if (!trackingCompletables.Contains(completable) && completable.getStart().Update(target))
                {
                    trackingCompletables.Add(completable);
                    times.Add(completable, DateTime.Now);
                    Tracker.T.completable.Initialized(completable.getId(), (CompletableTracker.Completable)completable.getType());
                    Tracker.T.completable.Progressed(completable.getId(), (CompletableTracker.Completable)completable.getType(), 0);

                    if (completable.getEnd() == null)
                    {
                        completeOnExit = completable;
                    }
                }
            }
        }