// KammusuListとLeaveAirsListをAirsListから作成する private static void MakeLists(AirsList airsList, out KammusuList kammusuList, out LeaveAirsList leaveAirsList) { kammusuList = new KammusuList(); leaveAirsList = new LeaveAirsList(); for (int i = 0; i < airsList.Count; ++i) { var tempList = new List <List <List <int> > >(); kammusuList.Add(Enumerable.Repeat(0, airsList[i].Count).ToList()); for (int j = 0; j < airsList[i].Count; ++j) { var tempList2 = new List <List <int> >(); for (int k = 0; k < airsList[i][j].Count; ++k) { var tempList3 = Enumerable.Repeat(0, airsList[i][j][k] + 1).ToList(); tempList2.Add(tempList3); } tempList.Add(tempList2); } leaveAirsList.Add(tempList); } }
/// <summary> /// コンストラクタ /// </summary> /// <param name="jsonString">JSON文字列</param> public Fleet(string jsonString) { // JSONをパース var obj = DynamicJson.Parse(jsonString); // パース結果を翻訳する var database = DataBaseService.Instance; foreach (var kammusuList in obj) { if (!kammusuList.IsDefined("kammusu")) { continue; } var list = new List <Kammusu>(); foreach (int id in kammusuList.kammusu) { list.Add(database.FindByKammusuId(id, false)); } KammusuList.Add(list); } }