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; }
public SweepMember(ISweeper parent, SweepMember_Input input, IReqOrderInput orderGenInput, IReqOrderPolicy reqOrderPolicy, IResumePolicy resumePolicy, IBalancePolicy balancePolicy) { this.Parent = parent; this.Input = input; this.Share = new SweepMember_Share(orderGenInput, reqOrderPolicy, resumePolicy, balancePolicy); this._state = new S1_RequestOrderState(this); }
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; }
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; }
public ISweepState Run(SweepMember_Input input, SweepMember_Share share) { //TODO return this; }