Example #1
0
        // 

        /// <summary>
        /// 建造記録を生成
        /// /kcsapi/api_get_member/kdock
        /// </summary>
        /// <param name="dockDat"></param>
        /// <param name="basicDat"></param>
        /// <param name="deckDat"></param>
        /// <param name="shipDat"></param>
        /// <returns></returns>
        public IEnumerable<LogData.CreateShipInfo> CreateLogData(MemberData.Dock dockDat,
            MemberData.Basic basicDat,MemberData.Deck deckDat,MemberData.Ship shipDat)
        {
            List<LogData.CreateShipInfo> retList = new List<LogData.CreateShipInfo>();
            for (int n = 0; n < kdock_build.Count(); n++)
            {
                ///既に建造記録を生成しているか、建造していないドックを飛ばす
                if (!kdock_build[n])
                    continue;

                var secretary = shipDat.GetShip(deckDat.Secretary);
                var info = new LogData.CreateShipInfo();
                lock (dockDat.KDockLock)
                {
                    var kdock = dockDat.GetKDock(n + 1);

                    info.Resource = new LogData.Material(kdock);
                    info.ShipType = kdock.Type;
                    info.ShipName = kdock.Name;
                    info.OfficeLv = basicDat.Level;
                    info.SecretaryShip = string.Format("{0}(Lv{1})", secretary.ShipName, secretary.Level);
                    info.Date = DateTime.Now;
                    info.MemberID = basicDat.MemberID;
                }

                retList.Add(info);

                Debug.WriteLine("KDockLog:" + info.ToString());

                kdock_build[n] = false;
            }

            if (retList.Count == 0)
                return null;

            return retList;
        }