public void Reset()
 {
     timeout?.Abort();
     isSwiping = false;
     deltaX    = 0;
     deltaY    = 0;
 }
예제 #2
0
        public void TestAbortFromFunctor()
        {
            Pipeline subject = new Pipeline();

            subject.Func(() => subject.Abort());
            subject.Update(0);
            Assert.Pass("Pipeline does not crash when aborting from within the pipeline itself");
        }
예제 #3
0
        private void AbortPipeline()
        {
            Pipeline pipeline = this.Pipeline;

            if (pipeline != null)
            {
                pipeline.Abort();
            }
        }
예제 #4
0
        public void TestAbortSetsIsDone()
        {
            bool     hasExecuted = true;
            Pipeline subject     = new Pipeline().Func(() => hasExecuted = true);

            subject.Abort();
            Assert.IsTrue(subject.IsDone, "Calling Abort does not set IsDone to false");
            subject.Update(0);
            Assert.IsTrue(hasExecuted, "Functor called even after the pipeline has been aborted");
        }
        public static void AccessException(this IIdempotenceService service, ILog log, Exception ex, Pipeline pipeline)
        {
            Guard.AgainstNull(service, "service");
            Guard.AgainstNull(log, "log");
            Guard.AgainstNull(ex, "ex");
            Guard.AgainstNull(pipeline, "pipeline");

            log.Fatal(string.Format(EsbResources.FatalIdempotenceServiceException, service.GetType().FullName,
                                    ex.AllMessages()));

            pipeline.Abort();
        }
예제 #6
0
    private void OnCollisionEnter(Collision col)
    {
        if (IsTarget(col.gameObject))
        {
            FixedJoint joint = gameObject.AddComponent <FixedJoint>();
            joint.connectedBody = col.rigidbody;
            hooked = col.gameObject.GetComponent <PlayerController>().Player;
            hooked.State.On(Player.States.Hooked);
            cancel.Abort();
            reverse = true;

            GetComponent <AudioSource>().clip = hitSfx;
            GetComponent <AudioSource>().Play();
        }
        else
        {
            Destroy();
        }
    }