Ejemplo n.º 1
0
 private List <IView> GetNewHistory(IView view, PushMode pushMode) =>
 pushMode == PushMode.Child
         ? History.Value.Append(view).ToList()
         : pushMode == PushMode.Sibling
             ? History.Value.Take(History.Value.Count - 1).Append(view).ToList()
             : new List <IView>
 {
     view
 };
        public static PushFunction PushMsg(PushMode pushMode, MsgType msgType)
        {
            PushFunction pt = null;

            switch (msgType)
            {
            case MsgType.Text:
                pt = new TextPush();                        //文本推送
                break;

            case MsgType.Img:
                pt = new ImagePush();                       //图片推送
                break;

            case MsgType.SingleTextAndImg:
                pt = new SingleTextAndImgPush();            //图文推送
                break;

            case MsgType.Exercise:
                pt = new ExercisePush();                    //习题推送
                break;

            case MsgType.Trained:
                pt = new SingleTextAndImgPush();            //培训推送
                break;

            case MsgType.KnowledgeBase:                     //知识库推送
                pt = new KnowledgeBasePush();
                break;

            case MsgType.Revenue:                           //营收推送
                pt = new RevenuePush();
                break;

            case MsgType.Agreement:
                pt = new AgreementPush();                   //协议推送
                break;

            case MsgType.RedPacket:                         //红包推送
                pt = new RedPacketPush();
                break;

            case MsgType.Payment:                           //企业付款推送
                pt = new PaymentPush();
                break;

            case MsgType.Salary:
                pt = new SalaryPush();                    //工资条推送
                break;

            case MsgType.Question:
                pt = new QuestionPush();
                break;
            }
            return(pt);
        }
Ejemplo n.º 3
0
    public void MoveGrave(PushMode pm, Vector2 push)
    {
        if (pm == PushMode.Charge) {
            rb.AddForceAtPosition(push*3.0f,transform.position, ForceMode2D.Impulse);
        }

        if (pm == PushMode.Drag || pm == PushMode.Wiggle) {
            rb.AddForceAtPosition(push*10.0f, transform.GetChild (0).transform.position,ForceMode2D.Impulse);
        }
    }
        public static PushFunction PushFunc(PushMode pushMode, MsgType msgType)
        {
            PushFunction pf = null;

            switch (pushMode)
            {
            case PushMode.WeChat:
                pf = PushWeChatFactory.PushMsg(pushMode, msgType);
                break;

            case PushMode.ShortMsg:
                //pf = PushShortMsg
                pf = PushShortMsgFactory.PushMsg(pushMode, msgType);
                break;
            }
            return(pf);
        }
        public static PushFunction PushMsg(PushMode pushMode, MsgType msgType)
        {
            PushFunction pt = null;

            switch (msgType)
            {
            case MsgType.NoticeSMS:
                pt = new NoticeSMS();                       //通知短信
                break;

            case MsgType.RevenueSMS:
                pt = new RevenueSMS();                      //营收短信
                break;

            case MsgType.VerificationCodeSMS:
                pt = new VerificationCodeSMS();             //验证码短信
                break;

            case MsgType.ValidVerificationCodeSMS:
                pt = new ValidVerificationCodeSMS();        //验证验证码短信
                break;
            }
            return(pt);
        }
Ejemplo n.º 6
0
 public PushModePresenterDecorator(IPresenter presenter, PushMode pushMode) : base(presenter)
 {
     _pushMode = pushMode;
 }
Ejemplo n.º 7
0
 public static IPresenter With(this IPresenter This, PushMode pushMode) =>
 new PushModePresenterDecorator(This, pushMode);
Ejemplo n.º 8
0
 void MoveGhost(Vector2 v, PushMode push)
 {
     transform.position += (Vector3) v;
     LimitDistance (push);
 }
Ejemplo n.º 9
0
    void LimitDistance(PushMode push)
    {
        float triedDistance = Vector2.Distance ((Vector2)transform.position, (Vector2)chainedTransform.position);

        if (triedDistance > maxDistance) {
            Vector3 moveDir = (transform.position - chainedTransform.position).normalized;
            transform.position = chainedTransform.position + moveDir * maxDistance;

            if (push != PushMode.None) {
                if (push == PushMode.Wiggle && graveTransform.GetComponent<Rigidbody2D>().velocity == Vector2.zero) {
                    wiggling = true;
                } else if (push == PushMode.Drag) {
                    wiggling = false;
                    mode = GhostMode.MouseMove;
                    gm.MoveGrave (push, (Vector2)moveDir * (triedDistance - maxDistance));
                }else if (push == PushMode.Charge) {
                    mode = GhostMode.MouseMove;
                    gm.MoveGrave (push, (Vector2)moveDir * chargePowerCurrent);
                    if (chargePowerMax < chargePowerBreak){
                        chargePowerCurrent = 0.0f;
                    }else{
                        GetComponent<ChainHandler>().BreakChain();
                        maxDistance = Mathf.Infinity;
                    }
                }
            }
        } else if (triedDistance < maxDistance - 0.05f)
            wiggling = false;
    }
Ejemplo n.º 10
0
 ///	<summary>Create <see cref="PushParameters"/>.</summary>
 ///	<param name="pushMode">Push mode.</param>
 ///	<param name="repository">Repository to push to.</param>
 ///	<param name="refspecs">References to push.</param>
 public PushParameters(string repository, PushMode pushMode, IList<string> refspecs)
 {
     Repository = repository;
     PushMode = pushMode;
     Refspecs = refspecs;
 }
Ejemplo n.º 11
0
 ///	<summary>Create <see cref="PushParameters"/>.</summary>
 ///	<param name="pushMode">Push mode.</param>
 ///	<param name="repository">Repository to push to.</param>
 ///	<param name="refspecs">References to push.</param>
 public PushParameters(string repository, PushMode pushMode, IList <string> refspecs)
 {
     Repository = repository;
     PushMode   = pushMode;
     Refspecs   = refspecs;
 }