Sakuno.KanColle.Amatsukaze.Game.Services.Records.SortieRecords.OnReturnedFromSortie C# (CSharp) Method

OnReturnedFromSortie() private method

private OnReturnedFromSortie ( SortieInfo rpSortie ) : void
rpSortie Sakuno.KanColle.Amatsukaze.Game.Models.SortieInfo
return void
        void OnReturnedFromSortie(SortieInfo rpSortie)
        {
            if (!r_ReturnReason.HasValue)
            {
                IEnumerable<Ship> rShips = rpSortie.Fleet.Ships;
                if (rpSortie.EscortFleet != null)
                    rShips = rShips.Concat(rpSortie.EscortFleet.Ships);

                r_ReturnReason = rShips.Any(rpShip => (rpShip.State & ShipState.HeavilyDamaged) != 0) ? ReturnReason.RetreatWithHeavilyDamagedShip : ReturnReason.Retreat;
            }

            using (var rTransaction = Connection.BeginTransaction())
            {
                InsertReturnReason(r_ReturnReason.Value);
                SetReturnTime(rpSortie.ReturnTime);

                rTransaction.Commit();
            }
        }