Exemplo n.º 1
0
        /// <summary>
        /// 2つのアイテムを統合する。集計用
        /// </summary>
        /// <param name="item">統合するアイテム</param>
        /// <returns>統合されたアイテム</returns>
        public SortieReportItem Integrate(SortieReportItem item)
        {
            var result = new SortieReportItem(true);

            //キーは自分のを流用
            result.Deck = this.Deck;
            //回数は加算
            result.NumSortie = this.NumSortie + item.NumSortie;
            result.NumBossApproached = this.NumBossApproached + item.NumBossApproached;
            result.NumBossDefeated = this.NumBossDefeated + item.NumBossDefeated;
            result.NumBossSWin = this.NumBossSWin + item.NumBossSWin;
            //獲得経験値も加算
            result.FlagshipExp = this.FlagshipExp + item.FlagshipExp;
            result.TotalExp = this.TotalExp + item.TotalExp;
            result.PlayerExp = this.PlayerExp + item.PlayerExp;
            result.CombinedFlagshipExp = this.CombinedFlagshipExp + item.CombinedFlagshipExp;
            result.CombinedTotalExp = this.CombinedTotalExp + item.CombinedTotalExp;
            //MVP獲得回数
            foreach(int i in Enumerable.Range(0, 6))
            {
                result.MVPCount[i] = this.MVPCount[i] + item.MVPCount[i];
                result.CombinedMVPCount[i] = this.CombinedMVPCount[i] + item.CombinedMVPCount[i];
            }
            //資源
            foreach(int i in Enumerable.Range(0, 8))
            {
                result.MaterialEarn[i] = this.MaterialEarn[i] + item.MaterialEarn[i];
                result.MaterialRepair[i] = this.MaterialRepair[i] + item.MaterialRepair[i];
                result.MaterialSupply[i] = this.MaterialSupply[i] + item.MaterialSupply[i];
            }
            //時間
            result.TimeSortie.AddRange(this.TimeSortie); result.TimeSortie.AddRange(item.TimeSortie);
            result.TimeBossApproached.AddRange(this.TimeBossApproached); result.TimeBossApproached.AddRange(item.TimeBossApproached);
            result.TimeBossDefeated.AddRange(this.TimeBossDefeated); result.TimeBossDefeated.AddRange(item.TimeBossDefeated);
            result.TimeBossSWin.AddRange(this.TimeBossSWin); result.TimeBossSWin.AddRange(item.TimeBossSWin);

            return result;
        }
Exemplo n.º 2
0
        /// <summary>
        /// インスタンスをディープコピーをします
        /// </summary>
        /// <returns>複製されたインスタンス</returns>
        public SortieReportItem DeepCopy()
        {
            SortieReportItem item = new SortieReportItem(true);

            item.Deck = this.Deck;

            item.NumSortie = this.NumSortie;
            item.NumBossApproached = this.NumBossApproached;
            item.NumBossDefeated = this.NumBossDefeated;
            item.NumBossSWin = this.NumBossSWin;

            item.FlagshipExp = this.FlagshipExp;
            item.TotalExp = this.TotalExp;
            item.PlayerExp = this.PlayerExp;
            item.CombinedFlagshipExp = this.CombinedFlagshipExp;
            item.CombinedTotalExp = this.CombinedTotalExp;

            item.MVPCount = this.MVPCount.Select(x => x).ToArray();//int[]
            item.CombinedMVPCount = this.CombinedMVPCount.Select(x => x).ToArray();//int[]

            item.MaterialEarn = this.MaterialEarn.Select(x => x).ToArray();//int[]
            item.MaterialSupply = this.MaterialSupply.Select(x => x).ToArray();//int[]
            item.MaterialRepair = this.MaterialRepair.Select(x => x).ToArray();//int[]

            item.TimeSortie = this.TimeSortie.Select(x => x).ToList();//List<TimeSpan>以下同様
            item.TimeBossApproached = this.TimeBossApproached.Select(x => x).ToList();
            item.TimeBossDefeated = this.TimeBossDefeated.Select(x => x).ToList();
            item.TimeBossSWin = this.TimeBossSWin.Select(x => x).ToList();

            return item;
        }