public override void OnResponseReceived( dynamic data ) {

			KCDatabase db = KCDatabase.Instance;

			// Admiral - 各所でバグるので封印
			//db.Admiral.LoadFromResponse( APIName, data.api_basic );


			// Equipments
			db.Equipments.Clear();
			foreach ( var elem in data.api_slot_item ) {

				var eq = new EquipmentData();
				eq.LoadFromResponse( APIName, elem );
				db.Equipments.Add( eq );

			}


			// Arsenal
			foreach ( var ars in data.api_kdock ) {

				int id = (int)ars.api_id;

				if ( !db.Arsenals.ContainsKey( id ) ) {
					var a = new ArsenalData();
					a.LoadFromResponse( APIName, ars );
					db.Arsenals.Add( a );

				} else {
					db.Arsenals[id].LoadFromResponse( APIName, ars );
				}
			}


			// UseItem
			db.UseItems.Clear();
			foreach ( var elem in data.api_useitem ) {

				var item = new UseItem();
				item.LoadFromResponse( APIName, elem );
				db.UseItems.Add( item );

			}


			base.OnResponseReceived( (object)data );
		}
示例#2
0
		public override void OnResponseReceived( dynamic data ) {

			KCDatabase db = KCDatabase.Instance;

			//api_kdock
			foreach ( var ars in data.api_kdock ) {

				int id = (int)ars.api_id;

				if ( !db.Arsenals.ContainsKey( id ) ) {
					var a = new ArsenalData();
					a.LoadFromResponse( APIName, ars );
					db.Arsenals.Add( a );

				} else {
					db.Arsenals[id].LoadFromResponse( APIName, ars );
				}
			}

			//api_slotitem
			if ( data.api_slotitem != null ) {				//装備なしの艦はnullになる
				foreach ( var elem in data.api_slotitem ) {

					var eq = new EquipmentData();
					eq.LoadFromResponse( APIName, elem );
					db.Equipments.Add( eq );

				}
			}

			//api_ship
			{
				ShipData ship = new ShipData();
				ship.LoadFromResponse( APIName, data.api_ship );
				db.Ships.Add( ship );

				Utility.Logger.Add( 2, string.Format( "{0}「{1}」の建造が完了しました。", ship.MasterShip.ShipTypeName, ship.MasterShip.NameWithClass ) );
			}


			base.OnResponseReceived( (object)data );
		}
示例#3
0
		public override void OnResponseReceived( dynamic data ) {

			KCDatabase db = KCDatabase.Instance;

			foreach ( var ars in data ) {

				int id = (int)ars.api_id;

				if ( !db.Arsenals.ContainsKey( id ) ) {
					var a = new ArsenalData();
					a.LoadFromResponse( APIName, ars );
					db.Arsenals.Add( a );

				} else {
					db.Arsenals[id].LoadFromResponse( APIName, ars );
				}
			}

			
			base.OnResponseReceived( (object)data );
		}