Exemplo n.º 1
0
        public override void LoadFromResponse(string apiname, dynamic data)
        {
            //base.LoadFromResponse( apiname, data );	//不要

            switch (apiname)
            {
            case "api_req_map/start":
            case "api_req_map/next":
                BattleDay   = null;
                BattleNight = null;
                Result      = null;
                BattleMode  = BattleModes.Undefined;
                Compass     = new CompassData();
                Compass.LoadFromResponse(apiname, data);
                break;

            case "api_req_sortie/battle":
                BattleMode = BattleModes.Normal;
                BattleDay  = new BattleNormalDay();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_battle_midnight/battle":
                BattleNight = new BattleNormalNight();
                BattleNight.TakeOverParameters(BattleDay);
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_battle_midnight/sp_midnight":
                BattleMode  = BattleModes.NightOnly;
                BattleNight = new BattleNightOnly();
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_sortie/airbattle":
                BattleMode = BattleModes.AirBattle;
                BattleDay  = new BattleAirBattle();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_sortie/ld_airbattle":
                BattleMode = BattleModes.AirRaid;
                BattleDay  = new BattleAirRaid();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/battle":
                BattleMode = BattleModes.Normal | BattleModes.CombinedTaskForce;
                BattleDay  = new BattleCombinedNormalDay();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/midnight_battle":
                BattleNight = new BattleCombinedNormalNight();
                //BattleNight.TakeOverParameters( BattleDay );		//checkme: 連合艦隊夜戦では昼戦での与ダメージがMVPに反映されない仕様?
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/sp_midnight":
                BattleMode  = BattleModes.NightOnly | BattleModes.CombinedMask;
                BattleNight = new BattleCombinedNightOnly();
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/airbattle":
                BattleMode = BattleModes.AirBattle | BattleModes.CombinedTaskForce;
                BattleDay  = new BattleCombinedAirBattle();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/battle_water":
                BattleMode = BattleModes.Normal | BattleModes.CombinedSurface;
                BattleDay  = new BattleCombinedWater();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/ld_airbattle":
                BattleMode = BattleModes.AirRaid | BattleModes.CombinedTaskForce;
                BattleDay  = new BattleCombinedAirRaid();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/ec_battle":
                BattleMode = BattleModes.Normal | BattleModes.EnemyCombinedFleet;
                BattleDay  = new BattleEnemyCombinedDay();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/ec_midnight_battle":
                BattleNight = new BattleEnemyCombinedNight();
                //BattleNight.TakeOverParameters( BattleDay );		//undone: これで正しいかは未検証
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/each_battle":
                BattleMode = BattleModes.Normal | BattleModes.CombinedTaskForce | BattleModes.EnemyCombinedFleet;
                BattleDay  = new BattleCombinedEachDay();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_combined_battle/each_battle_water":
                BattleMode = BattleModes.Normal | BattleModes.CombinedSurface | BattleModes.EnemyCombinedFleet;
                BattleDay  = new BattleCombinedEachWater();
                BattleDay.LoadFromResponse(apiname, data);
                break;


            case "api_req_member/get_practice_enemyinfo":
                EnemyAdmiralName = data.api_nickname;
                EnemyAdmiralRank = Constants.GetAdmiralRank((int)data.api_rank);
                break;

            case "api_req_practice/battle":
                BattleMode = BattleModes.Practice;
                BattleDay  = new BattlePracticeDay();
                BattleDay.LoadFromResponse(apiname, data);
                break;

            case "api_req_practice/midnight_battle":
                BattleNight = new BattlePracticeNight();
                BattleNight.TakeOverParameters(BattleDay);
                BattleNight.LoadFromResponse(apiname, data);
                break;

            case "api_req_sortie/battleresult":
            case "api_req_combined_battle/battleresult":
            case "api_req_practice/battle_result":
                Result = new BattleResultData();
                Result.LoadFromResponse(apiname, data);
                BattleFinished();
                break;

            case "api_port/port":
                Compass          = null;
                BattleDay        = null;
                BattleNight      = null;
                Result           = null;
                BattleMode       = BattleModes.Undefined;
                DroppedShipCount = DroppedEquipmentCount = 0;
                DroppedItemCount.Clear();
                break;

            case "api_get_member/slot_item":
                DroppedEquipmentCount = 0;
                break;
            }
        }
Exemplo n.º 2
0
		public override void LoadFromResponse( string apiname, dynamic data ) {
			//base.LoadFromResponse( apiname, data );	//不要

			switch ( apiname ) {
				case "api_req_map/start":
				case "api_req_map/next":
					BattleDay = null;
					BattleNight = null;
					Result = null;
					BattleMode = BattleModes.Undefined;
					Compass = new CompassData();
					Compass.LoadFromResponse( apiname, data );
					break;

				case "api_req_sortie/battle":
					BattleMode = BattleModes.Normal;
					BattleDay = new BattleNormalDay();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_battle_midnight/battle":
					BattleNight = new BattleNormalNight();
					BattleNight.TakeOverParameters( BattleDay );
					BattleNight.LoadFromResponse( apiname, data );
					break;

				case "api_req_battle_midnight/sp_midnight":
					BattleMode = BattleModes.NightOnly;
					BattleNight = new BattleNightOnly();
					BattleNight.LoadFromResponse( apiname, data );
					break;

				case "api_req_sortie/airbattle":
					BattleMode = BattleModes.AirBattle;
					BattleDay = new BattleAirBattle();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_sortie/ld_airbattle":
					BattleMode = BattleModes.AirRaid;
					BattleDay = new BattleAirRaid();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/battle":
					BattleMode = BattleModes.Normal | BattleModes.CombinedTaskForce;
					BattleDay = new BattleCombinedNormalDay();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/midnight_battle":
					BattleNight = new BattleCombinedNormalNight();
					//BattleNight.TakeOverParameters( BattleDay );		//checkme: 連合艦隊夜戦では昼戦での与ダメージがMVPに反映されない仕様?
					BattleNight.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/sp_midnight":
					BattleMode = BattleModes.NightOnly | BattleModes.CombinedMask;
					BattleNight = new BattleCombinedNightOnly();
					BattleNight.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/airbattle":
					BattleMode = BattleModes.AirBattle | BattleModes.CombinedTaskForce;
					BattleDay = new BattleCombinedAirBattle();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/battle_water":
					BattleMode = BattleModes.Normal | BattleModes.CombinedSurface;
					BattleDay = new BattleCombinedWater();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_combined_battle/ld_airbattle":
					BattleMode = BattleModes.AirRaid | BattleModes.CombinedTaskForce;
					BattleDay = new BattleCombinedAirRaid();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_member/get_practice_enemyinfo":
					EnemyAdmiralName = data.api_nickname;
					EnemyAdmiralRank = Constants.GetAdmiralRank( (int)data.api_rank );
					break;

				case "api_req_practice/battle":
					BattleMode = BattleModes.Practice;
					BattleDay = new BattlePracticeDay();
					BattleDay.LoadFromResponse( apiname, data );
					break;

				case "api_req_practice/midnight_battle":
					BattleNight = new BattlePracticeNight();
					BattleNight.TakeOverParameters( BattleDay );
					BattleNight.LoadFromResponse( apiname, data );
					break;

				case "api_req_sortie/battleresult":
				case "api_req_combined_battle/battleresult":
				case "api_req_practice/battle_result":
					Result = new BattleResultData();
					Result.LoadFromResponse( apiname, data );
					BattleFinished();
					break;

				case "api_port/port":
					Compass = null;
					BattleDay = null;
					BattleNight = null;
					Result = null;
					BattleMode = BattleModes.Undefined;
					DroppedShipCount = DroppedEquipmentCount = 0;
					DroppedItemCount.Clear();
					break;

				case "api_get_member/slot_item":
					DroppedEquipmentCount = 0;
					break;

			}

		}