Ejemplo n.º 1
0
            /// <summary>
            /// 创建方法,将构造器获取的数据构造成MetroModel
            /// </summary>
            /// <returns>MetroModel,失败时返回null</returns>
            public MetroModel Build()
            {
                if (_fileUrl == null)
                {
                    OnError(ErrorInfoManager.BUILDER_NO_FROM);
                    return(null);
                }
                // Read v from file.
                V v;

                if ((v = FileUtils.ReadV(_fileUrl, _onError)) == null)
                {
                    return(null);
                }
                // v to metroLines.
                _model = new MetroModel(new DataAdapter(v).GetMetroLines(),
                                        new DataAdapter(v).GetAllStations(), _name);
                return(_model);
            }
Ejemplo n.º 2
0
 public Thinker(MetroModel metro)
 {
     this._metro = metro;
 }