예제 #1
0
        private MarketRunner GetOrAdd(RunnerId rid)
        {
            MarketRunner runner;

            if (!_marketRunners.TryGetValue(rid, out runner))
            {
                runner = new MarketRunner(this, rid);
                _marketRunners[rid] = runner;
            }
            return(runner);
        }
예제 #2
0
        private void OnOrderRunnerChange(OrderRunnerChange orderRunnerChange)
        {
            RunnerId          rid = new RunnerId(orderRunnerChange.Id, orderRunnerChange.Hc);
            OrderMarketRunner orderMarketRunner;

            if (!_marketRunners.TryGetValue(rid, out orderMarketRunner))
            {
                orderMarketRunner   = new OrderMarketRunner(this, rid);
                _marketRunners[rid] = orderMarketRunner;
            }
            //update the runner
            orderMarketRunner.OnOrderRunnerChange(orderRunnerChange);
        }
예제 #3
0
        // override object.Equals
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            RunnerId runnerId = (RunnerId)obj;

            if (_selectionId != runnerId._selectionId)
            {
                return(false);
            }
            return(_handicap == runnerId._handicap);
        }
 public OrderMarketRunner(OrderMarket market, RunnerId runnerId)
 {
     _market   = market;
     _runnerId = runnerId;
 }
예제 #5
0
 public MarketRunner(Market market, RunnerId runnerId)
 {
     _market   = market;
     _runnerId = runnerId;
 }