Exemplo n.º 1
0
		/// <summary>
		/// 解析 api_start2 数据信息
		/// </summary>
		static void ParseSession(Session oSession)
		{
			SvData<kcsapi_start2> svd;
			if (!SvData.TryParse(oSession, out svd))
			{
				Log.Warning("GraphList.ParseSession()", "TryParse失败,无效的Session对象!");
				return;
			}

			var mst_shipgraph = svd.Data.api_mst_shipgraph
									.ToDictionary(x => x.api_id);
			var mst_ship = svd.Data.api_mst_ship
									.ToDictionary(x => x.api_id);
			var mst_stype = svd.Data.api_mst_stype
									.ToDictionary(x => x.api_id);

			graphList.Clear();

			foreach (var _pair in mst_shipgraph)
			{
				var item = new ship_graph_item();
				var _loc1 = _pair.Value;

				item.ship_id = _loc1.api_id;
				item.ship_filename = _loc1.api_filename;
				item.ship_version = _loc1.api_version;
				item.ship_graph_sortno = _loc1.api_sortno;

				if (mst_ship.ContainsKey(item.ship_id))
				{
					var _loc2 = mst_ship[item.ship_id];

					item.ship_sortno = _loc2.api_sortno;
					item.ship_name = _loc2.api_name;
					item.ship_type_id = _loc2.api_stype;

					if (mst_stype.ContainsKey(item.ship_type_id))
					{
						var _loc3 = mst_stype[item.ship_type_id];
						item.ship_type_name = _loc3.api_name;
						item.ship_type_sortno = _loc3.api_sortno;
					}

					graphList.Add(item);
					mst_ship.Remove(item.ship_id);
				}
				else
				{
#if DEBUG
					Debug.WriteLine(@"CACHR> shipgraph->ship匹配失败
> {0} = {1} {2} {3}
", _loc1.ToString(), _loc1.api_id, _loc1.api_sortno, _loc1.api_filename);
#endif
				}
			}

#if DEBUG
			Debug.WriteLine("CACHR>	graphList = {0}, mst_shipgraph = {1}",
						graphList.Count.ToString(),
						mst_shipgraph.Count.ToString()
						);
#endif
		}
Exemplo n.º 2
0
        /// <summary>
        /// 解析 api_start2 数据信息
        /// </summary>item.ship_graph_sortno
        static void ParseSession(Session oSession)
        {
            SvData <kcsapi_start2> svd;

            if (!SvData.TryParse(oSession, out svd))
            {
                Log.Warning("GraphList.ParseSession()", "TryParse失败,无效的Session对象!");
                return;
            }

            var mst_shipgraph = svd.Data.api_mst_shipgraph
                                .ToDictionary(x => x.api_id);
            var mst_ship = svd.Data.api_mst_ship
                           .ToDictionary(x => x.api_id);
            var mst_stype = svd.Data.api_mst_stype
                            .ToDictionary(x => x.api_id);

            graphList.Clear();

            foreach (var _pair in mst_shipgraph)
            {
                var item  = new ship_graph_item();
                var _loc1 = _pair.Value;

                item.ship_id                  = _loc1.api_id;
                item.ship_filename            = _loc1.api_filename;
                item.ship_graph_sortno        = _loc1.api_sortno;
                item.ship_graph_boko_n_left   = _loc1.api_boko_n[0];
                item.ship_graph_boko_n_top    = _loc1.api_boko_n[1];
                item.ship_graph_boko_d_left   = _loc1.api_boko_d[0];
                item.ship_graph_boko_d_top    = _loc1.api_boko_d[1];
                item.ship_graph_map_n_left    = _loc1.api_map_n[0];
                item.ship_graph_map_n_top     = _loc1.api_map_n[1];
                item.ship_graph_map_d_left    = _loc1.api_map_d[0];
                item.ship_graph_map_d_top     = _loc1.api_map_d[1];
                item.ship_graph_battle_n_left = _loc1.api_battle_n[0];
                item.ship_graph_battle_n_top  = _loc1.api_battle_n[1];
                item.ship_graph_battle_d_left = _loc1.api_battle_d[0];
                item.ship_graph_battle_d_top  = _loc1.api_battle_d[1];
                item.ship_graph_ensyuf_n_left = _loc1.api_ensyuf_n[0];
                item.ship_graph_ensyuf_n_top  = _loc1.api_ensyuf_n[1];
                item.ship_graph_ensyuf_d_left = _loc1.api_ensyuf_d[0];
                item.ship_graph_ensyuf_d_top  = _loc1.api_ensyuf_d[1];
                item.ship_graph_ensyue_n_left = _loc1.api_ensyue_n[0];
                item.ship_graph_ensyue_n_top  = _loc1.api_ensyue_n[1];
                item.ship_graph_kaizo_n_left  = _loc1.api_kaizo_n[0];
                item.ship_graph_kaizo_n_top   = _loc1.api_kaizo_n[1];
                item.ship_graph_kaizo_d_left  = _loc1.api_kaizo_d[0];
                item.ship_graph_kaizo_d_top   = _loc1.api_kaizo_d[1];
                item.ship_graph_kaisyu_n_left = _loc1.api_kaisyu_n[0];
                item.ship_graph_kaisyu_n_top  = _loc1.api_kaisyu_n[1];
                item.ship_graph_kaisyu_d_left = _loc1.api_kaisyu_d[0];
                item.ship_graph_kaisyu_d_top  = _loc1.api_kaisyu_d[1];
                item.ship_graph_weda_left     = _loc1.api_weda[0];
                item.ship_graph_weda_top      = _loc1.api_weda[1];
                item.ship_graph_wedb_left     = _loc1.api_wedb[0];
                item.ship_graph_wedb_top      = _loc1.api_wedb[1];

                if (mst_ship.ContainsKey(item.ship_id))
                {
                    var _loc2 = mst_ship[item.ship_id];

                    item.ship_sortno  = _loc2.api_sortno;
                    item.ship_name    = _loc2.api_name;
                    item.ship_type_id = _loc2.api_stype;

                    if (mst_stype.ContainsKey(item.ship_type_id))
                    {
                        var _loc3 = mst_stype[item.ship_type_id];
                        item.ship_type_name   = _loc3.api_name;
                        item.ship_type_sortno = _loc3.api_sortno;
                    }

                    graphList.Add(item);
                    mst_ship.Remove(item.ship_id);
                }
                else
                {
#if DEBUG
                    Debug.WriteLine(@"CACHR> shipgraph->ship匹配失败
> {0} = {1} {2} {3}
", _loc1.ToString(), _loc1.api_id, _loc1.api_sortno, _loc1.api_filename);
#endif
                }
            }

#if DEBUG
            Debug.WriteLine("CACHR>	graphList = {0}, mst_shipgraph = {1}",
                            graphList.Count.ToString(),
                            mst_shipgraph.Count.ToString()
                            );
#endif
        }
Exemplo n.º 3
0
        /// <summary>
        /// 解析 api_start2 数据信息
        /// </summary>
        static void ParseSession(kcsapi_start2 Data)
        {
            //SvData<kcsapi_start2> svd;
            //if (!SvData.TryParse(oSession, out svd))
            //{
            //	Log.Warning("GraphList.ParseSession()", "TryParse失败,无效的Session对象!");
            //	return;
            //}

            var mst_shipgraph = Data.api_mst_shipgraph
                                .ToDictionary(x => x.api_id);
            var mst_ship = Data.api_mst_ship
                           .ToDictionary(x => x.api_id);
            var mst_stype = Data.api_mst_stype
                            .ToDictionary(x => x.api_id);

            graphList.Clear();

            foreach (var _pair in mst_shipgraph)
            {
                var item  = new ship_graph_item();
                var _loc1 = _pair.Value;

                item.ship_id           = _loc1.api_id;
                item.ship_filename     = _loc1.api_filename;
                item.ship_version      = _loc1.api_version;
                item.ship_graph_sortno = _loc1.api_sortno;

                if (mst_ship.ContainsKey(item.ship_id))
                {
                    var _loc2 = mst_ship[item.ship_id];

                    item.ship_sortno  = _loc2.api_sortno;
                    item.ship_name    = _loc2.api_name;
                    item.ship_type_id = _loc2.api_stype;

                    if (mst_stype.ContainsKey(item.ship_type_id))
                    {
                        var _loc3 = mst_stype[item.ship_type_id];
                        item.ship_type_name   = _loc3.api_name;
                        item.ship_type_sortno = _loc3.api_sortno;
                    }

                    graphList.Add(item);
                    mst_ship.Remove(item.ship_id);
                }
                else
                {
#if DEBUG
                    Debug.WriteLine(@"CACHR> shipgraph->ship匹配失败
> {0} = {1} {2} {3}
", _loc1.ToString(), _loc1.api_id, _loc1.api_sortno, _loc1.api_filename);
#endif
                }
            }

#if DEBUG
            Debug.WriteLine("CACHR>	graphList = {0}, mst_shipgraph = {1}",
                            graphList.Count.ToString(),
                            mst_shipgraph.Count.ToString()
                            );
#endif
        }