public OpeningAswPhase(MasterDataRoot masterData, Side ally, Side enemy, RawShellingPhase raw) : base(0, masterData, ally, enemy, raw, true) { }
public RawBattle(BattleDetailJson api, DateTimeOffset?timeStamp = null) { bool fixEnemyId = timeStamp < EnemyIdChangeTime; bool oldSchema = timeStamp < BattleSchemaChangeTime; // Fleets ally.Formation = (Formation)api.api_formation.At(0); enemy.Formation = (Formation)api.api_formation.At(1); Engagement = (Engagement)api.api_formation.At(2); ally.Detection = api.api_search.At(0); enemy.Detection = api.api_search.At(1); HasNextPart = api.api_midnight_flag; if (api.api_maxhps != null) // Deprecated from 17Q4 { ally.Fleet = SelectFleet(api.api_maxhps.AsSpan(1, 6), api.api_nowhps.AsSpan(1, 6), api.api_fParam); enemy.Fleet = SelectFleet(api.api_maxhps.AsSpan(7, 6), api.api_nowhps.AsSpan(7, 6), api.api_eParam, api.api_ship_ke.AsSpan(1), api.api_ship_lv.AsSpan(1), api.api_eSlot, api.api_eKyouka, fixEnemyId); } if (api.api_maxhps_combined != null) { ally.Fleet2 = SelectFleet(api.api_maxhps_combined.AsSpan(1), api.api_nowhps_combined.AsSpan(1), api.api_fParam_combined); } if (api.api_f_maxhps != null) { ally.Fleet = SelectFleet(api.api_f_maxhps, api.api_f_nowhps, api.api_fParam); } if (api.api_f_maxhps_combined != null) { ally.Fleet2 = SelectFleet(api.api_f_maxhps_combined, api.api_f_nowhps_combined, api.api_fParam_combined); } if (api.api_e_maxhps != null) { enemy.Fleet = SelectFleet(api.api_e_maxhps, api.api_e_nowhps, api.api_eParam, api.api_ship_ke, api.api_ship_lv, api.api_eSlot, fixEnemyId: fixEnemyId); } if (api.api_e_maxhps_combined != null) { enemy.Fleet2 = SelectFleet(api.api_e_maxhps_combined, api.api_e_nowhps_combined, api.api_eParam_combined, api.api_ship_ke_combined, api.api_ship_lv_combined, api.api_eSlot_combined, fixEnemyId: fixEnemyId); } if (api.api_friendly_info != null) { NpcFleet = SelectFleet(api.api_friendly_info.api_maxhps, api.api_friendly_info.api_nowhps, api.api_friendly_info.api_Param, api.api_friendly_info.api_ship_id, api.api_friendly_info.api_ship_lv, api.api_friendly_info.api_Slot); } SetEscaped(ally.Fleet, api.api_escape_idx); SetEscaped(ally.Fleet2, api.api_escape_idx_combined); // Phases if (api.api_hougeki1 != null) { ShellingPhase1 = new RawShellingPhase(api.api_hougeki1); } if (api.api_hougeki2 != null) { ShellingPhase2 = new RawShellingPhase(api.api_hougeki2); } if (api.api_hougeki3 != null) { ShellingPhase3 = new RawShellingPhase(api.api_hougeki3); } if (api.api_opening_taisen != null) { OpeningAswPhase = new RawShellingPhase(api.api_opening_taisen); } if (api.api_hougeki != null) { NightPhase = new RawNightPhase(api.api_hougeki, api.api_touch_plane, api.api_flare_pos, api.api_active_deck); } if (api.api_n_hougeki1 != null) { NightPhase1 = new RawNightPhase(api.api_n_hougeki1, api.api_touch_plane, api.api_flare_pos, api.api_active_deck); } if (api.api_n_hougeki2 != null) { NightPhase2 = new RawNightPhase(api.api_n_hougeki2, api.api_touch_plane, api.api_flare_pos, api.api_active_deck); } if (api.api_opening_atack != null) { OpeningTorpedoPhase = new RawTorpedoPhase(api.api_opening_atack, oldSchema); } if (api.api_raigeki != null) { ClosingTorpedoPhase = new RawTorpedoPhase(api.api_raigeki, oldSchema); } if (api.api_kouku != null) { AerialPhase = new RawAerialPhase(api.api_kouku); } if (api.api_kouku2 != null) { AerialPhase2 = new RawAerialPhase(api.api_kouku2); } if (api.api_injection_kouku != null) { JetPhase = new RawAerialPhase(api.api_injection_kouku); } if (api.api_air_base_injection != null) { LandBaseJetPhase = new RawAerialPhase(api.api_air_base_injection); } LandBasePhases = api.api_air_base_attack?.Select(x => new RawLandBaseAerialPhase(x)).ToArray() ?? Array.Empty <RawLandBaseAerialPhase>(); // Support SupportFireType = (api.api_support_flag == SupportFireType.None) ? api.api_n_support_flag : api.api_support_flag; var support = api.api_support_info ?? api.api_n_support_info; if (support != null) { SupportFleet = (support.api_support_airatack?.api_ship_id ?? support.api_support_hourai?.api_ship_id) .Select(x => (ShipId)x).ToArray(); if (support.api_support_airatack != null) { AerialSupportPhase = new RawAerialPhase(support.api_support_airatack); } if (support.api_support_hourai != null) { SupportPhase = new RawSupportPhase(support.api_support_hourai); } } if (api.api_friendly_battle != null) { if (api.api_friendly_battle.api_hougeki != null) { NpcPhase = new RawNightPhase(api.api_friendly_battle.api_hougeki, null, api.api_friendly_battle.api_flare_pos, null); } } }
public ShellingPhase(int index, MasterDataRoot masterData, Side ally, Side enemy, RawShellingPhase raw, bool useFleet2 = false) : base(raw.OldSchema ? Initialze(masterData, raw, new OldBuilder(useFleet2 ? ally.Fleet2 : ally.Fleet, enemy.Fleet)) : Initialze(masterData, raw, new Builder(ally, enemy)), index) { }