FacilityDataTable.cs 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using Schedule;
  5. using UnityEngine;
  6. using wf;
  7. public static class FacilityDataTable
  8. {
  9. public static void Init()
  10. {
  11. FacilityDataTable.m_FacilityMaterialCategoryNameArray = new Dictionary<int, string>();
  12. FacilityDataTable.ReadCSV("facility_material_category.nei", delegate(CsvParser csv)
  13. {
  14. for (int i = 1; i < csv.max_cell_y; i++)
  15. {
  16. if (!csv.IsCellToExistData(0, i))
  17. {
  18. break;
  19. }
  20. int num = 0;
  21. int cellAsInteger = csv.GetCellAsInteger(num++, i);
  22. string cellAsString = csv.GetCellAsString(num++, i);
  23. FacilityDataTable.m_FacilityMaterialCategoryNameArray.Add(cellAsInteger, cellAsString);
  24. }
  25. });
  26. FacilityDataTable.m_FacilityParameterNameArray = new Dictionary<int, string>();
  27. FacilityDataTable.ReadCSV("facility_parameters.nei", delegate(CsvParser csv)
  28. {
  29. for (int i = 1; i < csv.max_cell_y; i++)
  30. {
  31. if (!csv.IsCellToExistData(0, i))
  32. {
  33. break;
  34. }
  35. int num = 0;
  36. int cellAsInteger = csv.GetCellAsInteger(num++, i);
  37. string cellAsString = csv.GetCellAsString(num++, i);
  38. FacilityDataTable.m_FacilityParameterNameArray.Add(cellAsInteger, cellAsString);
  39. }
  40. });
  41. FacilityDataTable.m_FacilityCostumeEnableMPN = new List<MPN>();
  42. FacilityDataTable.ReadCSV("facility_costume_mpn_enable_list.nei", delegate(CsvParser csv)
  43. {
  44. List<MPN> list = new List<MPN>();
  45. for (int i = 1; i < csv.max_cell_y; i++)
  46. {
  47. if (!csv.IsCellToExistData(0, i))
  48. {
  49. break;
  50. }
  51. string cellAsString = csv.GetCellAsString(0, i);
  52. MPN item = MPN.null_mpn;
  53. try
  54. {
  55. item = (MPN)Enum.Parse(typeof(MPN), cellAsString);
  56. }
  57. catch (Exception e)
  58. {
  59. NDebug.AssertParseError("MPN", e);
  60. }
  61. FacilityDataTable.m_FacilityCostumeEnableMPN.Add(item);
  62. }
  63. });
  64. FacilityDataTable.m_FacilityDefaultCostumeArray = new Dictionary<int, Dictionary<MPN, KeyValuePair<bool, string>>>();
  65. FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray = new Dictionary<int, string>();
  66. FacilityDataTable.ReadCSV("facility_default_costume.nei", delegate(CsvParser csv)
  67. {
  68. int i = 1;
  69. int j = 4;
  70. while (i < csv.max_cell_x)
  71. {
  72. Dictionary<MPN, KeyValuePair<bool, string>> dictionary = new Dictionary<MPN, KeyValuePair<bool, string>>();
  73. int cellAsInteger = csv.GetCellAsInteger(i, 3);
  74. for (j = 4; j < csv.max_cell_y; j++)
  75. {
  76. if (!csv.IsCellToExistData(0, j))
  77. {
  78. break;
  79. }
  80. string cellAsString = csv.GetCellAsString(0, j);
  81. string text = csv.GetCellAsString(i, j);
  82. MPN mpn = MPN.null_mpn;
  83. try
  84. {
  85. mpn = (MPN)Enum.Parse(typeof(MPN), cellAsString);
  86. }
  87. catch (Exception ex)
  88. {
  89. FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray.Add(cellAsInteger, text);
  90. break;
  91. }
  92. bool key = !string.IsNullOrEmpty(text);
  93. if (!string.IsNullOrEmpty(text) && text.ToLower() != "del")
  94. {
  95. text += ".menu";
  96. }
  97. else if (!CM3.dicDelItem.TryGetValue(mpn, out text))
  98. {
  99. Debug.LogWarningFormat("[FacilityDataTable]MPN[{0}]のDelPropの取得に失敗しました", new object[]
  100. {
  101. mpn
  102. });
  103. }
  104. dictionary.Add(mpn, new KeyValuePair<bool, string>(key, text));
  105. }
  106. FacilityDataTable.m_FacilityDefaultCostumeArray.Add(cellAsInteger, dictionary);
  107. i++;
  108. }
  109. });
  110. FacilityDataTable.m_FacilityBusinessTypeDataArray = new Dictionary<int, FacilityDataTable.BusinessTypeData>();
  111. FacilityDataTable.ReadCSVBusinessTypeData();
  112. FacilityDataTable.m_FacilityDefaultDataArray = new Dictionary<int, FacilityDataTable.FacilityDefaultData>();
  113. FacilityDataTable.m_FacilityRecipeDataArray = new Dictionary<int, FacilityDataTable.FacilityRecipeData>();
  114. FacilityDataTable.m_FacilityMaterialDataArray = new Dictionary<int, FacilityDataTable.FacilityMaterialData>();
  115. FacilityDataTable.ReadCSVFacilityDefaultData();
  116. FacilityDataTable.ReadCSVFacilityPowerUpData();
  117. FacilityDataTable.ReadCSVFacilityMaterialData();
  118. }
  119. private static CsvParser GetCSV(string name)
  120. {
  121. if (!GameUty.FileSystem.IsExistentFile(name))
  122. {
  123. Debug.LogWarning(string.Format("[FacilityDataTable]csv「{0}」が見つからない", name));
  124. return null;
  125. }
  126. AFileBase file = GameUty.FileSystem.FileOpen(name);
  127. CsvParser csvParser = new CsvParser();
  128. if (!csvParser.Open(file))
  129. {
  130. Debug.LogError(string.Format("[FacilityDataTable]csv「{0}」を開くのに失敗", name));
  131. }
  132. return csvParser;
  133. }
  134. private static void ReadCSV(string fileName, Action<CsvParser> callback)
  135. {
  136. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(fileName))
  137. {
  138. using (CsvParser csvParser = new CsvParser())
  139. {
  140. bool condition = csvParser.Open(afileBase);
  141. NDebug.Assert(condition, fileName + "\nopen failed.");
  142. callback(csvParser);
  143. }
  144. }
  145. }
  146. private static void ReadCSVFacilityDefaultData()
  147. {
  148. CsvParser csv = FacilityDataTable.GetCSV("facility_power_up.nei");
  149. Dictionary<int, int[]> dictionary = new Dictionary<int, int[]>();
  150. for (int i = 1; i < csv.max_cell_y; i++)
  151. {
  152. int cell_x = 0;
  153. int cellAsInteger = csv.GetCellAsInteger(cell_x++, i);
  154. string text = string.Empty;
  155. int[] array = null;
  156. if (csv.IsCellToExistData(cell_x, i))
  157. {
  158. text = csv.GetCellAsString(cell_x++, i);
  159. }
  160. if (!string.IsNullOrEmpty(text))
  161. {
  162. string[] array2 = text.Split(new char[]
  163. {
  164. ','
  165. });
  166. array = new int[array2.Length];
  167. for (int j = 0; j < array.Length; j++)
  168. {
  169. array[j] = int.Parse(array2[j]);
  170. }
  171. }
  172. dictionary.Add(cellAsInteger, array);
  173. }
  174. Dictionary<int, List<int>> dictionary2 = new Dictionary<int, List<int>>();
  175. CsvParser csv2 = FacilityDataTable.GetCSV("facility_level_table.nei");
  176. for (int k = 1; k < csv2.max_cell_y; k++)
  177. {
  178. int num = 0;
  179. if (!csv2.IsCellToExistData(0, k))
  180. {
  181. break;
  182. }
  183. int cellAsInteger2 = csv2.GetCellAsInteger(num++, k);
  184. num++;
  185. List<int> list = new List<int>();
  186. for (int l = 0; l < 5; l++)
  187. {
  188. if (csv2.IsCellToExistData(num, k))
  189. {
  190. list.Add(csv2.GetCellAsInteger(num, k));
  191. }
  192. else
  193. {
  194. list.Add(l * 100);
  195. }
  196. num++;
  197. }
  198. dictionary2.Add(cellAsInteger2, list);
  199. }
  200. HashSet<int> enableList = new HashSet<int>();
  201. string[] array3 = new string[]
  202. {
  203. "facility_enabled_list"
  204. };
  205. foreach (string fileName in array3)
  206. {
  207. CsvCommonIdManager.ReadEnabledIdList(GameUty.FileSystem, GameUty.PathList, fileName, ref enableList);
  208. }
  209. CsvParser csv3 = FacilityDataTable.GetCSV("facility.nei");
  210. for (int n = 1; n < csv3.max_cell_y; n++)
  211. {
  212. if (!csv3.IsCellToExistData(0, n))
  213. {
  214. break;
  215. }
  216. FacilityDataTable.FacilityDefaultData facilityDefaultData = new FacilityDataTable.FacilityDefaultData(csv3, dictionary, dictionary2, enableList, n);
  217. FacilityDataTable.m_FacilityDefaultDataArray.Add(facilityDefaultData.ID, facilityDefaultData);
  218. }
  219. }
  220. private static void ReadCSVFacilityPowerUpData()
  221. {
  222. CsvParser csv = FacilityDataTable.GetCSV("facility_power_up_list.nei");
  223. for (int i = 1; i < csv.max_cell_y; i++)
  224. {
  225. if (!csv.IsCellToExistData(0, i))
  226. {
  227. break;
  228. }
  229. FacilityDataTable.FacilityRecipeData facilityRecipeData = new FacilityDataTable.FacilityRecipeData(csv, i);
  230. FacilityDataTable.m_FacilityRecipeDataArray.Add(facilityRecipeData.ID, facilityRecipeData);
  231. }
  232. }
  233. private static void ReadCSVFacilityMaterialData()
  234. {
  235. CsvParser csv = FacilityDataTable.GetCSV("facility_material.nei");
  236. for (int i = 1; i < csv.max_cell_y; i++)
  237. {
  238. if (!csv.IsCellToExistData(0, i))
  239. {
  240. break;
  241. }
  242. FacilityDataTable.FacilityMaterialData facilityMaterialData = new FacilityDataTable.FacilityMaterialData(csv, i);
  243. FacilityDataTable.m_FacilityMaterialDataArray.Add(facilityMaterialData.ID, facilityMaterialData);
  244. }
  245. }
  246. private static void ReadCSVBusinessTypeData()
  247. {
  248. CsvParser csv = FacilityDataTable.GetCSV("facility_business_type.nei");
  249. for (int i = 1; i < csv.max_cell_y; i++)
  250. {
  251. if (!csv.IsCellToExistData(0, i))
  252. {
  253. break;
  254. }
  255. FacilityDataTable.BusinessTypeData businessTypeData = new FacilityDataTable.BusinessTypeData(csv, i);
  256. FacilityDataTable.m_FacilityBusinessTypeDataArray.Add(businessTypeData.ID, businessTypeData);
  257. }
  258. }
  259. public static FacilityDataTable.FacilityDefaultData GetFacilityDefaultData(int facilityTypeID, bool enableDataOnly = true)
  260. {
  261. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  262. {
  263. Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
  264. return null;
  265. }
  266. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  267. {
  268. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は存在しないデータです", facilityTypeID));
  269. return null;
  270. }
  271. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  272. {
  273. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は有効ではありません", facilityTypeID));
  274. return null;
  275. }
  276. return FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  277. }
  278. public static int GetFacilityTypeID(string facilityName)
  279. {
  280. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.GetFacilityDefaultData(facilityName, true);
  281. if (facilityDefaultData != null)
  282. {
  283. return facilityDefaultData.ID;
  284. }
  285. return -1;
  286. }
  287. public static FacilityDataTable.FacilityDefaultData GetFacilityDefaultData(string facilityDefaultName, bool enableDataOnly = true)
  288. {
  289. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  290. {
  291. NDebug.Assert("[FacilityDataTable]施設の基本情報の配列が未初期化です", false);
  292. return null;
  293. }
  294. foreach (KeyValuePair<int, FacilityDataTable.FacilityDefaultData> keyValuePair in FacilityDataTable.m_FacilityDefaultDataArray)
  295. {
  296. if (!(keyValuePair.Value.name != facilityDefaultName))
  297. {
  298. if (enableDataOnly && !keyValuePair.Value.isEnableData)
  299. {
  300. Debug.Log(string.Format("[FacilityDataTable]施設名[{0}]は有効ではありません", facilityDefaultName));
  301. return null;
  302. }
  303. return keyValuePair.Value;
  304. }
  305. }
  306. Debug.LogWarning(string.Format("施設名[{0}]は存在しないデータです", facilityDefaultName));
  307. return null;
  308. }
  309. public static Dictionary<int, ScheduleCSVData.Work> GetAllWorkData(bool enableDataOnly = true)
  310. {
  311. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  312. {
  313. Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
  314. return null;
  315. }
  316. Dictionary<int, ScheduleCSVData.Work> dictionary = new Dictionary<int, ScheduleCSVData.Work>();
  317. List<FacilityDataTable.FacilityDefaultData> list = new List<FacilityDataTable.FacilityDefaultData>(FacilityDataTable.m_FacilityDefaultDataArray.Values);
  318. for (int i = 0; i < list.Count; i++)
  319. {
  320. if (!enableDataOnly || list[i].isEnableData)
  321. {
  322. if (list[i].workData != null)
  323. {
  324. if (list[i].workData.id > 0)
  325. {
  326. if (dictionary.ContainsKey(list[i].workData.id))
  327. {
  328. NDebug.Assert("[営業施設と強化素材.xlsx]施設のスケジュールID" + list[i].workData.id + "が重複しています", false);
  329. return null;
  330. }
  331. dictionary.Add(list[i].workData.id, list[i].workData);
  332. }
  333. }
  334. }
  335. }
  336. return dictionary;
  337. }
  338. public static FacilityDataTable.FacilityRecipeData GetFacilityRecipeData(int recipeID)
  339. {
  340. if (FacilityDataTable.m_FacilityRecipeDataArray == null)
  341. {
  342. Debug.LogError("[FacilityDataTable]施設強化レシピの基本情報の配列が未初期化です");
  343. return null;
  344. }
  345. if (!FacilityDataTable.m_FacilityRecipeDataArray.ContainsKey(recipeID))
  346. {
  347. Debug.LogFormat("[FacilityDataTable]施設強化レシピID[{0}]は存在しないデータです", new object[]
  348. {
  349. recipeID
  350. });
  351. return null;
  352. }
  353. return FacilityDataTable.m_FacilityRecipeDataArray[recipeID];
  354. }
  355. public static Facility.FacilityStatus GetFacilityStatus(int facilityTypeID, bool enableDataOnly = true)
  356. {
  357. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  358. {
  359. Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
  360. return null;
  361. }
  362. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  363. {
  364. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は存在しないデータです", facilityTypeID));
  365. return null;
  366. }
  367. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  368. if (enableDataOnly && !facilityDefaultData.isEnableData)
  369. {
  370. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID[{0}]は有効ではありません", facilityTypeID));
  371. return null;
  372. }
  373. return new Facility.FacilityStatus
  374. {
  375. name = facilityDefaultData.name,
  376. termName = facilityDefaultData.termName,
  377. typeID = facilityDefaultData.ID,
  378. parameter = new Facility.FacilityParameter(facilityDefaultData.income, facilityDefaultData.valuation, facilityDefaultData.experienceValue)
  379. };
  380. }
  381. public static Facility.PowerUpRecipe GetFacilityPowerUpRecipe(int recipeID)
  382. {
  383. if (FacilityDataTable.m_FacilityRecipeDataArray == null)
  384. {
  385. Debug.LogError("[FacilityDataTable]強化レシピ情報の配列が未初期化です");
  386. return null;
  387. }
  388. if (!FacilityDataTable.m_FacilityRecipeDataArray.ContainsKey(recipeID))
  389. {
  390. Debug.Log(string.Format("[FacilityDataTable]施設強化レシピID[{0}]は存在しないデータです", recipeID));
  391. return null;
  392. }
  393. FacilityDataTable.FacilityRecipeData facilityRecipeData = FacilityDataTable.m_FacilityRecipeDataArray[recipeID];
  394. return new Facility.PowerUpRecipe
  395. {
  396. id = facilityRecipeData.ID,
  397. materialCategoryIDArray = facilityRecipeData.materialIDArray,
  398. name = facilityRecipeData.name,
  399. parameter = new Facility.FacilityParameter(facilityRecipeData.income, facilityRecipeData.valuation, facilityRecipeData.experienceValue)
  400. };
  401. }
  402. public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(int materialID)
  403. {
  404. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  405. {
  406. Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
  407. return null;
  408. }
  409. if (!FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID))
  410. {
  411. Debug.Log(string.Format("[FacilityDataTable]強化素材ID[{0}]は存在しないデータです", materialID));
  412. return null;
  413. }
  414. FacilityDataTable.FacilityMaterialData facilityMaterialData = FacilityDataTable.m_FacilityMaterialDataArray[materialID];
  415. return new Facility.PowerUpMaterial
  416. {
  417. id = facilityMaterialData.ID,
  418. categoryID = facilityMaterialData.categoryID,
  419. name = facilityMaterialData.name,
  420. parameter = new Facility.FacilityParameter(facilityMaterialData.income, facilityMaterialData.valuation, facilityMaterialData.experienceValue)
  421. };
  422. }
  423. public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(string materialName)
  424. {
  425. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  426. {
  427. Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
  428. return null;
  429. }
  430. foreach (KeyValuePair<int, FacilityDataTable.FacilityMaterialData> keyValuePair in FacilityDataTable.m_FacilityMaterialDataArray)
  431. {
  432. if (!(keyValuePair.Value.name != materialName))
  433. {
  434. return FacilityDataTable.GetFacilityPowerUpMaterial(keyValuePair.Value.ID);
  435. }
  436. }
  437. NDebug.Warning(string.Format("強化素材「{0}」の情報は存在しません", materialName));
  438. return null;
  439. }
  440. public static int GetFacilityPowerUpMaterialID(string materialName)
  441. {
  442. Facility.PowerUpMaterial facilityPowerUpMaterial = FacilityDataTable.GetFacilityPowerUpMaterial(materialName);
  443. if (facilityPowerUpMaterial != null)
  444. {
  445. return facilityPowerUpMaterial.id;
  446. }
  447. return -1;
  448. }
  449. public static Facility.FacilityStatus[] GetFacilityStatusArray(bool enableDataOnly = true)
  450. {
  451. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  452. {
  453. Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
  454. return null;
  455. }
  456. List<Facility.FacilityStatus> list = new List<Facility.FacilityStatus>();
  457. List<FacilityDataTable.FacilityDefaultData> list2 = new List<FacilityDataTable.FacilityDefaultData>(FacilityDataTable.m_FacilityDefaultDataArray.Values);
  458. for (int i = 0; i < list2.Count; i++)
  459. {
  460. if (!enableDataOnly || list2[i].isEnableData)
  461. {
  462. list.Add(FacilityDataTable.GetFacilityStatus(list2[i].ID, true));
  463. }
  464. }
  465. return list.ToArray();
  466. }
  467. public static int[] GetFacilityPowerUpMaterialIDArray()
  468. {
  469. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  470. {
  471. Debug.LogError("[FacilityDataTable]施設の強化素材情報の配列が未初期化です");
  472. return null;
  473. }
  474. List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialDataArray.Keys);
  475. return list.ToArray();
  476. }
  477. public static Facility.PowerUpRecipe[] GetFacilityPowerUpRecipeArray()
  478. {
  479. if (FacilityDataTable.m_FacilityRecipeDataArray == null)
  480. {
  481. Debug.LogError("[FacilityDataTable]施設強化レシピ情報の配列が未初期化です");
  482. return null;
  483. }
  484. List<Facility.PowerUpRecipe> list = new List<Facility.PowerUpRecipe>();
  485. List<FacilityDataTable.FacilityRecipeData> list2 = new List<FacilityDataTable.FacilityRecipeData>(FacilityDataTable.m_FacilityRecipeDataArray.Values);
  486. for (int i = 0; i < list2.Count; i++)
  487. {
  488. list.Add(FacilityDataTable.GetFacilityPowerUpRecipe(list2[i].ID));
  489. }
  490. return list.ToArray();
  491. }
  492. public static bool IsExistFacilityData(int facilityTypeID, bool enableDataOnly = true)
  493. {
  494. return FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID) && (!enableDataOnly || FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData);
  495. }
  496. public static bool IsExistPowerUpMaterial(int materialID)
  497. {
  498. return FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID);
  499. }
  500. public static Facility.PowerUpMaterial[] GetFacilityPowerUpMaterialArray(int materialCategoryID)
  501. {
  502. List<Facility.PowerUpMaterial> list = new List<Facility.PowerUpMaterial>();
  503. List<FacilityDataTable.FacilityMaterialData> list2 = new List<FacilityDataTable.FacilityMaterialData>(FacilityDataTable.m_FacilityMaterialDataArray.Values);
  504. for (int i = 0; i < list2.Count; i++)
  505. {
  506. if (list2[i].categoryID == materialCategoryID)
  507. {
  508. list.Add(FacilityDataTable.GetFacilityPowerUpMaterial(list2[i].ID));
  509. }
  510. }
  511. return list.ToArray();
  512. }
  513. public static int GetFacilityPowerUpMaterialCount()
  514. {
  515. return FacilityDataTable.m_FacilityMaterialDataArray.Count;
  516. }
  517. public static bool IsExistFacilityPowerUpRecipe(int facilityTypeID, bool enableDataOnly = true)
  518. {
  519. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  520. {
  521. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  522. return false;
  523. }
  524. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  525. {
  526. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  527. return false;
  528. }
  529. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  530. return facilityDefaultData.powerUpRecipeIDArray != null;
  531. }
  532. public static int[] GetFacilityPowerUpRecipeIDArray(int facilityTypeID, bool enableDataOnly = true)
  533. {
  534. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  535. {
  536. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  537. return null;
  538. }
  539. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  540. {
  541. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  542. return null;
  543. }
  544. return FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].powerUpRecipeIDArray;
  545. }
  546. public static string GetFacilityPowerUpMaterialCategoryName(int categoryID)
  547. {
  548. if (!FacilityDataTable.m_FacilityMaterialCategoryNameArray.ContainsKey(categoryID))
  549. {
  550. Debug.LogWarning(string.Format("[FacilityDataTable]素材カテゴリID「{0}」のデータは存在しない", categoryID));
  551. return null;
  552. }
  553. return FacilityDataTable.m_FacilityMaterialCategoryNameArray[categoryID];
  554. }
  555. public static int[] GetFacilityPowerUpMaterialCategoryIDArray()
  556. {
  557. List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialCategoryNameArray.Keys);
  558. return list.ToArray();
  559. }
  560. public static string GetFacilityParameterName(int parameterID)
  561. {
  562. if (!FacilityDataTable.m_FacilityParameterNameArray.ContainsKey(parameterID))
  563. {
  564. Debug.LogWarning(string.Format("[FacilityDataTable]施設パラメータID「{0}」のデータは存在しない", parameterID));
  565. return null;
  566. }
  567. return FacilityDataTable.m_FacilityParameterNameArray[parameterID];
  568. }
  569. public static bool GetFacilityCanBeUsedBusiness(int facilityID, bool enableDataOnly = true)
  570. {
  571. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  572. {
  573. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  574. return false;
  575. }
  576. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  577. {
  578. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  579. return false;
  580. }
  581. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isBusiness;
  582. }
  583. public static bool GetFacilityCanBeDestroy(int facilityID, bool enableDataOnly = true)
  584. {
  585. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  586. {
  587. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  588. return false;
  589. }
  590. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  591. {
  592. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  593. return false;
  594. }
  595. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isRemoval;
  596. }
  597. public static bool GetFacilityDefaultPlacement(int facilityID, bool enableDataOnly = true)
  598. {
  599. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  600. {
  601. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  602. return false;
  603. }
  604. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  605. {
  606. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  607. return false;
  608. }
  609. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isDefaultPlace;
  610. }
  611. public static int GetFacilityDefaultCost(int facilityID, bool enableDataOnly = true)
  612. {
  613. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  614. {
  615. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  616. return 0;
  617. }
  618. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  619. {
  620. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  621. return 0;
  622. }
  623. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].cost;
  624. }
  625. public static Sprite GetFacilityThumbnail(int facilityTypeID, bool enableDataOnly = true)
  626. {
  627. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  628. {
  629. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  630. return null;
  631. }
  632. if (FacilityDataTable.m_FacilityThumbnailCacheDic == null)
  633. {
  634. FacilityDataTable.m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
  635. }
  636. Sprite sprite;
  637. if (FacilityDataTable.m_FacilityThumbnailCacheDic.TryGetValue(facilityTypeID, out sprite))
  638. {
  639. return sprite;
  640. }
  641. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  642. if (enableDataOnly && !facilityDefaultData.isEnableData)
  643. {
  644. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  645. return null;
  646. }
  647. string text = facilityDefaultData.imageThumbnailName + ".tex";
  648. if (string.IsNullOrEmpty(text))
  649. {
  650. Debug.Log(string.Format("施設の種類ID[{0}]にはサムネイル画像情報がありません", facilityTypeID));
  651. return null;
  652. }
  653. if (!GameUty.FileSystem.IsExistentFile(text))
  654. {
  655. Debug.Log(string.Format("施設『{0}』のサムネイル画像「{1}」が見つかりませんでした", facilityDefaultData.name, text));
  656. return null;
  657. }
  658. Texture2D tex = ImportCM.CreateTexture(text);
  659. sprite = uGUIUtility.CreateSprite(tex);
  660. FacilityDataTable.m_FacilityThumbnailCacheDic.Add(facilityTypeID, sprite);
  661. return sprite;
  662. }
  663. public static Dictionary<MPN, KeyValuePair<bool, string>> GetFacilityDefaultCostume(int facilityTypeID, bool enableDataOnly = true)
  664. {
  665. if (!FacilityDataTable.m_FacilityDefaultCostumeArray.ContainsKey(facilityTypeID))
  666. {
  667. return null;
  668. }
  669. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  670. {
  671. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  672. return null;
  673. }
  674. Dictionary<MPN, KeyValuePair<bool, string>> dictionary = FacilityDataTable.m_FacilityDefaultCostumeArray[facilityTypeID];
  675. MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
  676. Dictionary<MPN, KeyValuePair<bool, string>> dictionary2 = new Dictionary<MPN, KeyValuePair<bool, string>>();
  677. foreach (MPN key in facilityCostumeEnableMPN)
  678. {
  679. if (dictionary.ContainsKey(key))
  680. {
  681. dictionary2.Add(key, dictionary[key]);
  682. }
  683. }
  684. return dictionary2;
  685. }
  686. public static string GetFacilityDefaultCostumeThumbnailName(int facilityTypeID, bool enableDataOnly = true)
  687. {
  688. if (!FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray.ContainsKey(facilityTypeID))
  689. {
  690. return null;
  691. }
  692. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  693. {
  694. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  695. return null;
  696. }
  697. return FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray[facilityTypeID];
  698. }
  699. public static MPN[] GetFacilityCostumeEnableMPN()
  700. {
  701. return FacilityDataTable.m_FacilityCostumeEnableMPN.ToArray();
  702. }
  703. public static bool IsEnableFacilityCostumeMPN(MPN mpn)
  704. {
  705. return FacilityDataTable.m_FacilityCostumeEnableMPN.Contains(mpn);
  706. }
  707. public static int[] GetFacilityBusinessTypeIDArray(bool isExclusionEmptyData = true)
  708. {
  709. List<int> list = null;
  710. if (isExclusionEmptyData)
  711. {
  712. list = new List<int>();
  713. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  714. {
  715. if (keyValuePair.Key != 9999)
  716. {
  717. list.Add(keyValuePair.Key);
  718. }
  719. }
  720. }
  721. else
  722. {
  723. list = new List<int>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Keys);
  724. }
  725. return list.ToArray();
  726. }
  727. public static FacilityDataTable.BusinessTypeData[] GetFacilityBusinessTypeDataArray(bool isExclusionEmptyData = true)
  728. {
  729. List<FacilityDataTable.BusinessTypeData> list = null;
  730. if (isExclusionEmptyData)
  731. {
  732. list = new List<FacilityDataTable.BusinessTypeData>();
  733. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  734. {
  735. if (keyValuePair.Key != 9999)
  736. {
  737. list.Add(keyValuePair.Value);
  738. }
  739. }
  740. }
  741. else
  742. {
  743. list = new List<FacilityDataTable.BusinessTypeData>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Values);
  744. }
  745. return list.ToArray();
  746. }
  747. public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(int businessTypeID)
  748. {
  749. if (!FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID))
  750. {
  751. Debug.LogWarningFormat("[FacilityDataTable]事業の種類ID「{0}」に対応する情報がありません", new object[]
  752. {
  753. businessTypeID
  754. });
  755. return null;
  756. }
  757. return FacilityDataTable.m_FacilityBusinessTypeDataArray[businessTypeID];
  758. }
  759. public static bool IsExistFacilityBusinessTypeData(int businessTypeID)
  760. {
  761. return FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID);
  762. }
  763. public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(string businessName)
  764. {
  765. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  766. {
  767. if (!(keyValuePair.Value.name != businessName))
  768. {
  769. return keyValuePair.Value;
  770. }
  771. }
  772. Debug.LogWarningFormat("[FacilityDataTable]事業の名前「{0}」に対応する情報がありません", new object[]
  773. {
  774. businessName
  775. });
  776. return null;
  777. }
  778. private static Dictionary<int, FacilityDataTable.FacilityDefaultData> m_FacilityDefaultDataArray;
  779. private static Dictionary<int, FacilityDataTable.FacilityRecipeData> m_FacilityRecipeDataArray;
  780. private static Dictionary<int, FacilityDataTable.FacilityMaterialData> m_FacilityMaterialDataArray;
  781. private static Dictionary<int, FacilityDataTable.BusinessTypeData> m_FacilityBusinessTypeDataArray;
  782. private static Dictionary<int, string> m_FacilityMaterialCategoryNameArray;
  783. private static Dictionary<int, string> m_FacilityParameterNameArray;
  784. private static Dictionary<int, Dictionary<MPN, KeyValuePair<bool, string>>> m_FacilityDefaultCostumeArray;
  785. private static Dictionary<int, string> m_FacilityDefaultCostumeThumbnailArray;
  786. private static List<MPN> m_FacilityCostumeEnableMPN;
  787. private static Dictionary<int, Sprite> m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
  788. public enum BusinessType
  789. {
  790. 接待系 = 100,
  791. 営業系 = 200,
  792. アイドル系 = 300,
  793. 無し = 9999
  794. }
  795. public class FacilityDefaultData
  796. {
  797. public FacilityDefaultData(CsvParser csv, Dictionary<int, int[]> recipeIDArray, Dictionary<int, List<int>> levelTableList, HashSet<int> enableList, int y)
  798. {
  799. int num = 0;
  800. this.ID = csv.GetCellAsInteger(num++, y);
  801. int cellAsInteger = csv.GetCellAsInteger(num++, y);
  802. this.name = csv.GetCellAsString(num++, y);
  803. csv.GetCellAsString(num++, y);
  804. this.businessTypeName = csv.GetCellAsString(num++, y);
  805. this.businessTypeID = FacilityDataTable.GetFacilityBusinessTypeData(this.businessTypeName).ID;
  806. this.upwardFacilityID = csv.GetCellAsInteger(num++, y);
  807. this.fileName = csv.GetCellAsString(num++, y);
  808. this.fileNameNight = csv.GetCellAsString(num++, y);
  809. this.rank = csv.GetCellAsInteger(num++, y);
  810. string cellAsString = csv.GetCellAsString(num++, y);
  811. this.cost = csv.GetCellAsInteger(num++, y);
  812. this.income = csv.GetCellAsInteger(num++, y);
  813. this.valuation = csv.GetCellAsInteger(num++, y);
  814. this.experienceValue = csv.GetCellAsInteger(num++, y);
  815. this.isBusiness = (csv.GetCellAsString(num++, y) == "〇");
  816. this.isDefaultPlace = (csv.GetCellAsString(num++, y) == "〇");
  817. this.isRemoval = (csv.GetCellAsString(num++, y) == "〇");
  818. string cellAsString2 = csv.GetCellAsString(num++, y);
  819. this.imageThumbnailName = csv.GetCellAsString(num++, y);
  820. string cellAsString3 = csv.GetCellAsString(num++, y);
  821. this.minMaidCount = csv.GetCellAsInteger(num++, y);
  822. this.maxMaidCount = csv.GetCellAsInteger(num++, y);
  823. this.heroineMagnification = csv.GetCellAsInteger(num++, y);
  824. string cellAsString4 = csv.GetCellAsString(num++, y);
  825. this.isEnableData = enableList.Contains(this.ID);
  826. if (string.IsNullOrEmpty(cellAsString2))
  827. {
  828. this.isEnableNTR = true;
  829. this.isOnlyNTR = false;
  830. }
  831. else if (cellAsString2 == "×")
  832. {
  833. this.isEnableNTR = false;
  834. this.isOnlyNTR = false;
  835. }
  836. else if (cellAsString2 == "〇" || cellAsString2 == "○")
  837. {
  838. this.isEnableNTR = true;
  839. this.isOnlyNTR = true;
  840. }
  841. if (recipeIDArray.ContainsKey(this.ID))
  842. {
  843. this.powerUpRecipeIDArray = recipeIDArray[this.ID];
  844. }
  845. else
  846. {
  847. this.powerUpRecipeIDArray = null;
  848. }
  849. string[] array = cellAsString.Split(new char[]
  850. {
  851. ','
  852. });
  853. this.staffRankArray = new int[4];
  854. for (int i = 0; i < this.staffRankArray.Length; i++)
  855. {
  856. try
  857. {
  858. int.TryParse(array[i], out this.staffRankArray[i]);
  859. }
  860. catch (Exception ex)
  861. {
  862. this.staffRankArray[i] = 0;
  863. }
  864. }
  865. if (levelTableList.ContainsKey(this.ID))
  866. {
  867. this.levelTable = levelTableList[this.ID];
  868. }
  869. else
  870. {
  871. this.levelTable = new List<int>();
  872. this.levelTable.Add(0);
  873. this.levelTable.Add(100);
  874. this.levelTable.Add(200);
  875. this.levelTable.Add(300);
  876. this.levelTable.Add(400);
  877. }
  878. try
  879. {
  880. this.businessType = (FacilityDataTable.BusinessType)Enum.Parse(typeof(FacilityDataTable.BusinessType), this.businessTypeName);
  881. }
  882. catch (Exception e)
  883. {
  884. NDebug.AssertParseError("BusinessType", e);
  885. }
  886. if (cellAsInteger < 0)
  887. {
  888. return;
  889. }
  890. this.workData = new ScheduleCSVData.Work();
  891. this.workData.type = ScheduleTaskCtrl.TaskType.Work;
  892. this.workData.id = cellAsInteger;
  893. this.workData.name = csv.GetCellAsString(num++, y);
  894. this.workData.icon = cellAsString3;
  895. string cellAsString5 = csv.GetCellAsString(num++, y);
  896. if (!string.IsNullOrEmpty(cellAsString5) && Enum.IsDefined(typeof(ScheduleCSVData.TrainingType), cellAsString5))
  897. {
  898. this.workData.trainingType = (ScheduleCSVData.TrainingType)Enum.Parse(typeof(ScheduleCSVData.TrainingType), cellAsString5, false);
  899. }
  900. this.workData.study_rate = csv.GetCellAsInteger(num++, y);
  901. this.workData.reception = csv.GetCellAsInteger(num++, y);
  902. this.workData.care = csv.GetCellAsInteger(num++, y);
  903. this.workData.lovely = csv.GetCellAsInteger(num++, y);
  904. this.workData.elegance = csv.GetCellAsInteger(num++, y);
  905. this.workData.charm = csv.GetCellAsInteger(num++, y);
  906. this.workData.teach_rate = csv.GetCellAsInteger(num++, y);
  907. this.workData.cooking = csv.GetCellAsInteger(num++, y);
  908. this.workData.vocal = csv.GetCellAsInteger(num++, y);
  909. this.workData.dance = csv.GetCellAsInteger(num++, y);
  910. this.workData.appealPoint = csv.GetCellAsInteger(num++, y);
  911. this.workData.exp = csv.GetCellAsInteger(num++, y);
  912. this.workData.income = csv.GetCellAsInteger(num++, y);
  913. this.workData.cmdExp = csv.GetCellAsInteger(num++, y);
  914. string cellAsString6 = csv.GetCellAsString(num++, y);
  915. this.workData.condContract = new List<Contract>();
  916. string[] array2 = cellAsString6.Split(new char[]
  917. {
  918. '|'
  919. }, StringSplitOptions.RemoveEmptyEntries);
  920. for (int j = 0; j < array2.Length; j++)
  921. {
  922. if (Enum.IsDefined(typeof(Contract), array2[j]))
  923. {
  924. this.workData.condContract.Add((Contract)Enum.Parse(typeof(Contract), array2[j], false));
  925. }
  926. }
  927. string cellAsString7 = csv.GetCellAsString(num++, y);
  928. this.workData.condMaidClass = new List<int>();
  929. string[] array3 = cellAsString7.Split(new char[]
  930. {
  931. '&'
  932. }, StringSplitOptions.RemoveEmptyEntries);
  933. for (int k = 0; k < array3.Length; k++)
  934. {
  935. int id = JobClass.GetData(array3[k]).id;
  936. this.workData.condMaidClass.Add(id);
  937. }
  938. this.workData.needEventItemIdList = new List<int>();
  939. if (csv.GetCellAsString(num, 0) == "必要状態")
  940. {
  941. this.workData.needMaidStatus = csv.GetCellAsString(num++, y);
  942. string cellAsString8 = csv.GetCellAsString(num++, y);
  943. if (!string.IsNullOrEmpty(cellAsString8))
  944. {
  945. string[] array4 = cellAsString8.Split(new char[]
  946. {
  947. '|'
  948. });
  949. foreach (string s in array4)
  950. {
  951. this.workData.needEventItemIdList.Add(int.Parse(s));
  952. }
  953. }
  954. }
  955. if (num < csv.max_cell_x)
  956. {
  957. string cellAsString9 = csv.GetCellAsString(num, y);
  958. if (cellAsString9 != null)
  959. {
  960. if (!(cellAsString9 == "表示"))
  961. {
  962. if (cellAsString9 == "非表示")
  963. {
  964. this.workData.disableIfRentalMaid = true;
  965. }
  966. }
  967. else
  968. {
  969. this.workData.visibleIfRentalMaid = true;
  970. }
  971. }
  972. }
  973. num++;
  974. this.workData.condPackage = new List<string>();
  975. if (this.workData.id > 0)
  976. {
  977. this.workData.categoryID = 52;
  978. }
  979. this.workData.facility = this;
  980. }
  981. public bool isExistUpwardFacility
  982. {
  983. get
  984. {
  985. return FacilityDataTable.IsExistFacilityData(this.upwardFacilityID, true);
  986. }
  987. }
  988. public FacilityDataTable.FacilityDefaultData upwardFacility
  989. {
  990. get
  991. {
  992. if (!this.isExistUpwardFacility)
  993. {
  994. return null;
  995. }
  996. return FacilityDataTable.GetFacilityDefaultData(this.upwardFacilityID, true);
  997. }
  998. }
  999. public string termName
  1000. {
  1001. get
  1002. {
  1003. return "SceneFacilityManagement/施設名/" + this.name;
  1004. }
  1005. }
  1006. public const string termRootText = "SceneFacilityManagement/";
  1007. public readonly int ID;
  1008. public readonly string name;
  1009. public readonly string businessTypeName;
  1010. public readonly int businessTypeID;
  1011. public readonly FacilityDataTable.BusinessType businessType;
  1012. public readonly string fileName;
  1013. public readonly string fileNameNight;
  1014. public readonly int cost;
  1015. public readonly int income;
  1016. public readonly int valuation;
  1017. public readonly int experienceValue;
  1018. public readonly bool isBusiness;
  1019. public readonly bool isDefaultPlace;
  1020. public readonly bool isRemoval;
  1021. public readonly string imageThumbnailName;
  1022. public readonly int[] powerUpRecipeIDArray;
  1023. public readonly int minMaidCount;
  1024. public readonly int maxMaidCount;
  1025. public readonly int heroineMagnification;
  1026. public readonly int rank;
  1027. public readonly int[] staffRankArray;
  1028. public readonly List<int> levelTable;
  1029. public readonly ScheduleCSVData.Work workData;
  1030. public readonly bool isEnableNTR;
  1031. public readonly bool isOnlyNTR;
  1032. public readonly bool isEnableData;
  1033. private readonly int upwardFacilityID;
  1034. }
  1035. public class FacilityRecipeData
  1036. {
  1037. public FacilityRecipeData(CsvParser csv, int y)
  1038. {
  1039. int num = 0;
  1040. this.ID = csv.GetCellAsInteger(num++, y);
  1041. this.name = csv.GetCellAsString(num++, y);
  1042. string cellAsString = csv.GetCellAsString(num++, y);
  1043. this.conditions = new string[FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM];
  1044. for (int i = 0; i < FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM; i++)
  1045. {
  1046. this.conditions[i] = csv.GetCellAsString(num++, y);
  1047. }
  1048. this.salonGrade = csv.GetCellAsInteger(num++, y);
  1049. string cellAsString2 = csv.GetCellAsString(num++, y);
  1050. if (!string.IsNullOrEmpty(cellAsString2))
  1051. {
  1052. string[] array = cellAsString2.Split(new char[]
  1053. {
  1054. ','
  1055. });
  1056. ParametersPack.StatusType key = ParametersPack.NameToStatusType(array[0]);
  1057. this.statusType = new KeyValuePair<ParametersPack.StatusType, int>(key, int.Parse(array[1]));
  1058. }
  1059. this.income = csv.GetCellAsInteger(num++, y);
  1060. this.valuation = csv.GetCellAsInteger(num++, y);
  1061. this.experienceValue = csv.GetCellAsInteger(num++, y);
  1062. if (!string.IsNullOrEmpty(cellAsString))
  1063. {
  1064. string[] array2 = cellAsString.Split(new char[]
  1065. {
  1066. ','
  1067. });
  1068. this.materialIDArray = new int[array2.Length];
  1069. for (int j = 0; j < array2.Length; j++)
  1070. {
  1071. this.materialIDArray[j] = int.Parse(array2[j]);
  1072. }
  1073. }
  1074. else
  1075. {
  1076. this.materialIDArray = null;
  1077. }
  1078. }
  1079. public bool IsSatisfyTheConditions()
  1080. {
  1081. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  1082. bool flag = true;
  1083. flag &= (this.salonGrade <= GameMain.Instance.CharacterMgr.status.clubGrade);
  1084. if (maid != null && this.statusType.Value > 0)
  1085. {
  1086. flag &= (this.statusType.Value <= FacilityDataTable.FacilityRecipeData.GetMaidStatusValue(maid, this.statusType.Key.ToString()));
  1087. }
  1088. else
  1089. {
  1090. Debug.LogWarning("メイド0番が見つかりません");
  1091. }
  1092. return flag;
  1093. }
  1094. private static int GetMaidStatusValue(Maid maid, string name)
  1095. {
  1096. switch (name)
  1097. {
  1098. case "接待":
  1099. return maid.status.reception;
  1100. case "お世話":
  1101. return maid.status.care;
  1102. case "可憐":
  1103. return maid.status.lovely;
  1104. case "気品":
  1105. return maid.status.elegance;
  1106. case "魅惑":
  1107. return maid.status.charm;
  1108. case "料理":
  1109. return maid.status.cooking;
  1110. case "ボーカル":
  1111. return maid.status.vocal;
  1112. case "ダンス":
  1113. return maid.status.dance;
  1114. case "アピールポイント":
  1115. return maid.status.appealPoint;
  1116. case "淫欲":
  1117. return maid.status.inyoku;
  1118. case "M性":
  1119. return maid.status.mvalue;
  1120. case "変態":
  1121. return maid.status.hentai;
  1122. case "奉仕":
  1123. return maid.status.housi;
  1124. case "指導":
  1125. return maid.status.teachRate;
  1126. case "経験人数":
  1127. return maid.status.sexPlayNumberOfPeople;
  1128. case "人気ランク":
  1129. return maid.status.popularRank;
  1130. case "評価":
  1131. return maid.status.evaluation;
  1132. }
  1133. Debug.LogWarning("メイドパラメータ名" + name + "に対応する処理は未定義でした");
  1134. return 9999;
  1135. }
  1136. public static readonly int CONDITIONS_NUM = 4;
  1137. public readonly int ID;
  1138. public readonly string name;
  1139. public readonly int[] materialIDArray;
  1140. public readonly int income;
  1141. public readonly int valuation;
  1142. public readonly int experienceValue;
  1143. public readonly string[] conditions;
  1144. public readonly int salonGrade;
  1145. public readonly KeyValuePair<ParametersPack.StatusType, int> statusType;
  1146. }
  1147. public class FacilityMaterialData
  1148. {
  1149. public FacilityMaterialData(CsvParser csv, int y)
  1150. {
  1151. int num = 0;
  1152. this.ID = csv.GetCellAsInteger(num++, y);
  1153. this.name = csv.GetCellAsString(num++, y);
  1154. this.categoryID = csv.GetCellAsInteger(num++, y);
  1155. this.income = csv.GetCellAsInteger(num++, y);
  1156. this.valuation = csv.GetCellAsInteger(num++, y);
  1157. this.experienceValue = csv.GetCellAsInteger(num++, y);
  1158. }
  1159. public readonly int ID;
  1160. public readonly string name;
  1161. public readonly int categoryID;
  1162. public readonly int income;
  1163. public readonly int valuation;
  1164. public readonly int experienceValue;
  1165. }
  1166. public class BusinessTypeData
  1167. {
  1168. public BusinessTypeData(CsvParser csv, int y)
  1169. {
  1170. int num = 0;
  1171. this.ID = csv.GetCellAsInteger(num++, y);
  1172. this.name = csv.GetCellAsString(num++, y);
  1173. this.fileName = csv.GetCellAsString(num++, y);
  1174. this.description = csv.GetCellAsString(num++, y);
  1175. this.conditions = new string[FacilityDataTable.BusinessTypeData.CONDITIONS_NUM];
  1176. for (int i = 0; i < FacilityDataTable.BusinessTypeData.CONDITIONS_NUM; i++)
  1177. {
  1178. this.conditions[i] = csv.GetCellAsString(num++, y);
  1179. }
  1180. }
  1181. public static readonly int CONDITIONS_NUM = 2;
  1182. public readonly int ID;
  1183. public readonly string name;
  1184. public readonly string fileName;
  1185. public readonly string description;
  1186. public readonly string[] conditions;
  1187. }
  1188. }