public List <KCB> GetKCBFormvw_Cschedule_ForAtyIandTCID(int AtyID, int TCID) { var itemlist = GetEntityFromDAL(AtyID).Where(d => d.TCID != null & d.TCID == TCID).Select(d => new { d.CCode, d.CCname, d.TCName, d.havenum, d.PsName, d.StartW, d.EndW, d.DSZ, d.DayOfWeek, d.SectionTH, d.BuildName, d.CRname, d.PsNumber, d.TCID, d.PSID, d.AtyID, d.CCID, d.CRID, d.CSID }).OrderBy(d => d.StartW).ThenBy(d => d.DayOfWeek).ThenBy(d => d.SectionTH).ToList(); if (itemlist.Count > 0) { List <KCB> KCBList = new List <KCB>(); foreach (var item in itemlist) { KCB kcb = new KCB(); kcb.CCID = item.CCID; kcb.TCID = item.TCID; kcb.TeacherName = item.PsName; kcb.CourseName = item.CCname; kcb.CSID = item.CSID; kcb.PSID = item.PSID; kcb.SingleOrDouble = item.DSZ; kcb.StartWeek = item.StartW; kcb.EndWeek = item.EndW; kcb.Week = item.DayOfWeek; kcb.Section = item.SectionTH; KCBList.Add(kcb); kcb = null; } return(KCBList); } return(null); }
public Item(KCB.api_start2.ApiData.ApiMstMission json) { MissionID = (int)json.api_id; MapArea = (int)json.api_maparea_id; Name = json.api_name; Detail = json.api_details; MinutesRequired = (int)json.api_time; Diffculty = (int)json.api_difficulty; FuelUse = (double)json.api_use_fuel; BulletUse = (double)json.api_use_bull; }
/// <summary> /// 内部状態の初期化 /// </summary> /// <param name="result">戦闘結果</param> /// <param name="_memberShip"></param> /// <param name="fleetInfo">艦隊情報</param> /// <param name="_masterShip"></param> private void initializeShipData(KCB.api_req_sortie.Battle.ApiData result, MemberData.Deck.Fleet fleetInfo, MemberData.Ship _memberShip, MasterData.Ship _masterShip) { Debug.WriteLine("戦闘開始/艦隊番号:" + fleetInfo.Num.ToString()); _battleResult = new Result(result.api_midnight_flag == 1,_practice); //戦闘形態を取得する _battleResult.Friend.Formation = (Result.FleetState.FormationType)result.api_formation[0]; _battleResult.Enemy.Formation = (Result.FleetState.FormationType)result.api_formation[1]; if (result.api_search != null) { _battleResult.Friend.SearchResult = (Result.FleetState.SearchResultType)result.api_search[0]; _battleResult.Enemy.SearchResult = (Result.FleetState.SearchResultType)result.api_search[1]; } else { _battleResult.Friend.SearchResult = Result.FleetState.SearchResultType.索敵なし; _battleResult.Enemy.SearchResult = Result.FleetState.SearchResultType.索敵なし; } _battleResult.MatchState = (Result.MatchType)result.api_formation[2]; Debug.WriteLine(string.Format("自陣形:{0} {1}\n敵陣形:{2} {3}\n交戦形態:{4}\n夜戦:{5}", _battleResult.Friend.Formation,_battleResult.Friend.SearchResult, _battleResult.Enemy.Formation,_battleResult.Enemy.SearchResult, _battleResult.MatchState, _battleResult.HasNightBattle)); ///味方艦隊の情報を取得する for (int i = 0; i < fleetInfo.Member.Count; i++) { var ship_id = fleetInfo.Member[i]; var ship = _memberShip.GetShip(ship_id); var info = _battleResult.Friend.Ships[i]; info.Initialize(ship_id,ship.ShipNameId,ship.ShipName,ship.ShipTypeId, result.api_maxhps[i + 1],result.api_nowhps[i + 1]); Debug.WriteLine(string.Format("No.{0} ID:{1} Name:{2} HP:{3}", i + 1, ship_id, ship.ShipName,ship.HP.ToString())); } ///敵艦隊の情報を取得する for (int i = 0; i < 6; i++) { int ship_id = result.api_ship_ke[i + 1]; if (ship_id < 0) continue; var ship = _masterShip.LookupShipMaster(ship_id); var info = _battleResult.Enemy.Ships[i]; string shipName; if(_practice) shipName = ship.Name; else shipName = string.Format("{0}{1}", ship.Name, ship.Yomi); info.Initialize(-1,ship_id,shipName,ship.ShipTypeId, result.api_maxhps[i + 7],result.api_nowhps[i + 7]); Debug.WriteLine(string.Format("No.{0} Name:{1} HP:{2}/{3}", i + 1, shipName, result.api_maxhps[i + 7], result.api_nowhps[i + 7])); } }
/// <summary> /// 砲雷撃戦の結果処理 /// </summary> /// <param name="hougeki"></param> /// <param name="result"></param> private int getHougekiDamage(KCB.api_req_sortie.Battle.ApiData.ApiHougeki hougeki, Result result, MasterData.Item _masterItem) { if (hougeki == null) return 0; //長さが一致しない if (hougeki.api_damage.Count != hougeki.api_df_list.Count) return 0; int battleTime = 0; //攻撃先のHPを減算 for (int i = 1; i < hougeki.api_damage.Count; i++) { var targets = (Newtonsoft.Json.Linq.JArray)hougeki.api_df_list[i]; var damages = (Newtonsoft.Json.Linq.JArray)hougeki.api_damage[i]; var weapons = (Newtonsoft.Json.Linq.JArray)hougeki.api_si_list[i]; int from = hougeki.api_at_list[i]; for (int j = 0; j < targets.Count; j++) { int target = (int)targets[j]; double damage = (double)damages[j]; int weapon_id = (int)weapons[j]; var weapon = _masterItem.GetItemParam(weapon_id); if(weapon == null) Debug.WriteLine(string.Format("砲撃:{0}->{1} ダメージ:{2} 装備:なし", from, target, damage)); else Debug.WriteLine(string.Format("砲撃:{0}->{1} ダメージ:{2} 装備:{3}", from, target, damage , weapon.Name)); if (target > 0 && target <= 6) { var it = result.Friend.Ships[target - 1]; //敵→味方 var critical = it.AddDamage(damage); if (critical) battleTime += CriticalHitTime; if(it.Submarine) battleTime += HouRaiSubmarine; } else if (target > 0 && target <= 12) { var it = result.Enemy.Ships[target - 7]; //味方→敵 it.AddDamage(damage); if (it.Submarine) battleTime += HouRaiSubmarine; } battleTime += HouRai; } } return battleTime; }
/// <summary> /// 建造パラメタを設定 /// </summary> /// <param name="data">パラメタ</param> public void UpdateMaterialParam(KCB.api_get_member.KDock.ApiData data) { Fuel = data.api_item1; Ammo = data.api_item2; Steel = data.api_item3; Bauxite = data.api_item4; Dev = data.api_item5; }
/// <summary> /// レスポンスから /// </summary> /// <param name="req">リクエストパラメタ</param> /// <param name="json">レスポンス情報</param> public CreateItemInfo(IDictionary<string, string> req, KCB.api_req_kousyou.CreateItem.ApiData json) // public CreateItemInfo(IDictionary<string, string> req, dynamic json) { Succeess = false; Number = 0; ItemNameID = 0; ItemType = ""; ItemName = "(失敗)"; Date = DateTime.Now; Resource = new Material(req); if ((int)json.api_create_flag == 0) return; Succeess = true; ItemNameID = (int)json.api_slot_item.api_slotitem_id; }
public void UpdateRequireInfo(KCB.api_get_member.RequireInfo.ApiData.ApiBasic data) { MemberID = data.api_member_id.ToString(); Debug.WriteLine("BASIC(3) MemberID:" + MemberID); }
public bool UpdatePort(KCB.api_port.Port.ApiData.ApiBasic data) { _initialiized = true; MemberID = data.api_member_id; Nick = data.api_nickname; Level = data.api_level; Rank = data.api_rank; Experience = data.api_experience; MaxShip = data.api_max_chara; MaxItem = data.api_max_slotitem; Deck = data.api_count_deck; KDock = data.api_count_kdock; NDock = data.api_count_ndock; FurnitureCoin = data.api_fcoin; Debug.WriteLine(string.Format( "BASIC(2) MemberID:{0} Nick:{1} Lv:{2} Rank:{3} Exp;{4} ShipMax:{5} ItemMax:{6} Deck:{7} KDock:{8} NDock:{9} FCoin:{10}", MemberID, Nick, Level, Rank, Experience, MaxShip, MaxItem, Deck, KDock, NDock, FurnitureCoin)); return true; }
/// <summary> /// 装備改装 /// </summary> /// <param name="data">改装情報</param> /// <param name="itemMaster">マスタデータ</param> public void Remodel(KCB.api_req_kousyou.RemodelSlot.ApiData.ApiAfterSlot data, MasterData.Item itemMaster) { ItemUID = data.api_id; SlotItemType = data.api_slotitem_id; Locked = data.api_locked == 1; Level = data.api_level; ApplyMasterSlotItemInfo(itemMaster); }
// public Info(dynamic data) public Info(KCB.api_get_member.Slot_Item.ApiData data, MasterData.Item itemMaster) { Owner = null; ItemUID = data.api_id; SlotItemType = data.api_slotitem_id; Locked = data.api_locked == 1; if (data.api_alv == null) Level = data.api_level; else if (data.api_alv > 0) Level = (int) data.api_alv; else Level = data.api_level; ApplyMasterSlotItemInfo(itemMaster); }