Пример #1
0
        public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
        {
            try
            {
                long reqCount = Math.Abs(share.TargetCount) - Math.Abs(share.ContractedCount);
                if (reqCount == 0)
                {
                    return new S6_DoneState(_parent);
                }

                POrder order = share.ReqOrderPolicy.GetOrder(share);
                if (order != null)
                {
                    POrderUtil.RequestOrder(order, share.Orders);
                }
                ISweepState next = new S2_WaitGotOrderNumState(_parent);
                return next;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
            return this;
        }
Пример #2
0
        public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
        {
            if (share.ResumePolicy.IsResumeChance(share))
            {
                // 여기서 에이징한다.
                share.AdvanceAging();

                ISweepState next = new S4_CancelRemainsState(_parent);
                return next;
            }
            return this;
        }
        public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
        {
            foreach (POrder o in share.Orders)
            {
                if (!o.IsDone())
                {
                    return this;
                }
            }

            ISweepState next = new S1_RequestOrderState(_parent);
            return next;
        }
Пример #4
0
        public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
        {
            foreach (POrder o in share.Orders)
            {
                if (o.IsDone())
                {
                    continue;
                }
                o.CancelRemains();
            }

            ISweepState next = new S5_CancelRemainsDoneWaitingState(_parent);
            return next;
        }
        public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
        {
            foreach (POrder order in share.Orders)
            {
                if (!order.IsCompleteGotOrderNumber())
                {
                    return this;
                }
            }

            share.ResumePolicy.Reset(share);
            ISweepState next = new S3_ResumeMonitorState(_parent);
            return next;
        }
Пример #6
0
 public ISweepState Run(SweepMember_Input input, SweepMember_Share share)
 {
     //TODO
     return this;
 }