Esempio n. 1
0
        public ScrollerConstArg(
            ScrollerAxis scrollerAxis,
            Vector2 relativeCursorPosition,
            Vector2 rubberBandLimitMultiplier,
            bool isEnabledInertia,
            float newScrollSpeedThreshold,

            IUIManager uim,
            IUISystemProcessFactory processFactory,
            IUIElementFactory uieFactory,
            IScrollerAdaptor uia,
            IUIImage uiImage,
            ActivationMode activationMode
            ) : base(
                uim,
                processFactory,
                uieFactory,
                uia,
                uiImage,
                activationMode
                )
        {
            thisScrollerAxis              = scrollerAxis;
            thisRelativeCursorPos         = relativeCursorPosition;
            thisRubberBandLimitMultiplier = rubberBandLimitMultiplier;
            thisIsEnabledInertia          = isEnabledInertia;
            thisNewScrollSpeedThreshold   = newScrollSpeedThreshold;
        }
            public ConstArg(
                ScrollerAxis scrollerAxis,
                Vector2 relativeCursorPosition,
                Vector2 rubberBandLimitMultiplier,
                bool isEnabledInertia,
                float inertiaDecay,
                float newScrollSpeedThreshold,

                IScrollerAdaptor adaptor,
                ActivationMode activationMode
                ) : base(
                    adaptor,
                    activationMode
                    )
            {
                thisScrollerAxis              = scrollerAxis;
                thisRelativeCursorPos         = relativeCursorPosition;
                thisRubberBandLimitMultiplier = rubberBandLimitMultiplier;
                thisIsEnabledInertia          = isEnabledInertia;
                thisInertiaDecay              = inertiaDecay;
                thisNewScrollSpeedThreshold   = newScrollSpeedThreshold;
            }
Esempio n. 3
0
    public IUIElementGroupScrollerConstArg CreateMockConstArg(
        int initiallyCursoredElementIndex,
        int[] cursorSize,
        Vector2 relativeCursorPosition,
        ScrollerAxis scrollerAxis,
        Vector2 rubberBandLimitMultiplier,
        Vector2 scrollerLength,
        Vector2 elementGroupLength
        )
    {
        IUIElementGroupScrollerConstArg arg = Substitute.For <IUIElementGroupScrollerConstArg>();

        arg.initiallyCursoredGroupElementIndex.Returns(initiallyCursoredElementIndex);
        arg.cursorSize.Returns(cursorSize);
        arg.startSearchSpeed.Returns(1f);
        arg.relativeCursorPosition.Returns(relativeCursorPosition);
        arg.scrollerAxis.Returns(scrollerAxis);
        arg.rubberBandLimitMultiplier.Returns(rubberBandLimitMultiplier);
        arg.isEnabledInertia.Returns(true);
        arg.swipeToSnapNext.Returns(false);
        arg.uim.Returns(Substitute.For <IUIManager>());
        arg.processFactory.Returns(Substitute.For <IUISystemProcessFactory>());
        arg.uiElementFactory.Returns(Substitute.For <IUIElementFactory>());
        IScrollerAdaptor scrollerAdaptor = Substitute.For <IScrollerAdaptor>();

        scrollerAdaptor.GetRect().Returns(new Rect(Vector2.zero, scrollerLength));
        IUIElementGroup uieGroup = Substitute.For <IUIElementGroup>();

        uieGroup.GetGroupElementArrayIndex(Arg.Any <IUIElement>()).Returns(new int[] { 0, 0 });
        IUIElementGroupAdaptor uieGroupAdaptor = Substitute.For <IUIElementGroupAdaptor>();

        uieGroup.GetUIAdaptor().Returns(uieGroupAdaptor);
        uieGroupAdaptor.GetRect().Returns(new Rect(Vector2.zero, elementGroupLength));
        scrollerAdaptor.GetChildUIEs().Returns(new List <IUIElement>(new IUIElement[] { uieGroup }));
        arg.uia.Returns(scrollerAdaptor);
        arg.image.Returns(Substitute.For <IUIImage>());
        return(arg);
    }