FacilityDataTable.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  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. typeID = facilityDefaultData.ID,
  377. parameter = new Facility.FacilityParameter(facilityDefaultData.income, facilityDefaultData.valuation, facilityDefaultData.experienceValue)
  378. };
  379. }
  380. public static Facility.PowerUpRecipe GetFacilityPowerUpRecipe(int recipeID)
  381. {
  382. if (FacilityDataTable.m_FacilityRecipeDataArray == null)
  383. {
  384. Debug.LogError("[FacilityDataTable]強化レシピ情報の配列が未初期化です");
  385. return null;
  386. }
  387. if (!FacilityDataTable.m_FacilityRecipeDataArray.ContainsKey(recipeID))
  388. {
  389. Debug.Log(string.Format("[FacilityDataTable]施設強化レシピID[{0}]は存在しないデータです", recipeID));
  390. return null;
  391. }
  392. FacilityDataTable.FacilityRecipeData facilityRecipeData = FacilityDataTable.m_FacilityRecipeDataArray[recipeID];
  393. return new Facility.PowerUpRecipe
  394. {
  395. id = facilityRecipeData.ID,
  396. materialCategoryIDArray = facilityRecipeData.materialIDArray,
  397. name = facilityRecipeData.name,
  398. parameter = new Facility.FacilityParameter(facilityRecipeData.income, facilityRecipeData.valuation, facilityRecipeData.experienceValue)
  399. };
  400. }
  401. public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(int materialID)
  402. {
  403. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  404. {
  405. Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
  406. return null;
  407. }
  408. if (!FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID))
  409. {
  410. Debug.Log(string.Format("[FacilityDataTable]強化素材ID[{0}]は存在しないデータです", materialID));
  411. return null;
  412. }
  413. FacilityDataTable.FacilityMaterialData facilityMaterialData = FacilityDataTable.m_FacilityMaterialDataArray[materialID];
  414. return new Facility.PowerUpMaterial
  415. {
  416. id = facilityMaterialData.ID,
  417. categoryID = facilityMaterialData.categoryID,
  418. name = facilityMaterialData.name,
  419. parameter = new Facility.FacilityParameter(facilityMaterialData.income, facilityMaterialData.valuation, facilityMaterialData.experienceValue)
  420. };
  421. }
  422. public static Facility.PowerUpMaterial GetFacilityPowerUpMaterial(string materialName)
  423. {
  424. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  425. {
  426. Debug.LogError("[FacilityDataTable]強化素材の情報の配列が未初期化です");
  427. return null;
  428. }
  429. foreach (KeyValuePair<int, FacilityDataTable.FacilityMaterialData> keyValuePair in FacilityDataTable.m_FacilityMaterialDataArray)
  430. {
  431. if (!(keyValuePair.Value.name != materialName))
  432. {
  433. return FacilityDataTable.GetFacilityPowerUpMaterial(keyValuePair.Value.ID);
  434. }
  435. }
  436. NDebug.Warning(string.Format("強化素材「{0}」の情報は存在しません", materialName));
  437. return null;
  438. }
  439. public static int GetFacilityPowerUpMaterialID(string materialName)
  440. {
  441. Facility.PowerUpMaterial facilityPowerUpMaterial = FacilityDataTable.GetFacilityPowerUpMaterial(materialName);
  442. if (facilityPowerUpMaterial != null)
  443. {
  444. return facilityPowerUpMaterial.id;
  445. }
  446. return -1;
  447. }
  448. public static Facility.FacilityStatus[] GetFacilityStatusArray(bool enableDataOnly = true)
  449. {
  450. if (FacilityDataTable.m_FacilityDefaultDataArray == null)
  451. {
  452. Debug.LogError("[FacilityDataTable]施設の基本情報の配列が未初期化です");
  453. return null;
  454. }
  455. List<Facility.FacilityStatus> list = new List<Facility.FacilityStatus>();
  456. List<FacilityDataTable.FacilityDefaultData> list2 = new List<FacilityDataTable.FacilityDefaultData>(FacilityDataTable.m_FacilityDefaultDataArray.Values);
  457. for (int i = 0; i < list2.Count; i++)
  458. {
  459. if (!enableDataOnly || list2[i].isEnableData)
  460. {
  461. list.Add(FacilityDataTable.GetFacilityStatus(list2[i].ID, true));
  462. }
  463. }
  464. return list.ToArray();
  465. }
  466. public static int[] GetFacilityPowerUpMaterialIDArray()
  467. {
  468. if (FacilityDataTable.m_FacilityMaterialDataArray == null)
  469. {
  470. Debug.LogError("[FacilityDataTable]施設の強化素材情報の配列が未初期化です");
  471. return null;
  472. }
  473. List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialDataArray.Keys);
  474. return list.ToArray();
  475. }
  476. public static Facility.PowerUpRecipe[] GetFacilityPowerUpRecipeArray()
  477. {
  478. if (FacilityDataTable.m_FacilityRecipeDataArray == null)
  479. {
  480. Debug.LogError("[FacilityDataTable]施設強化レシピ情報の配列が未初期化です");
  481. return null;
  482. }
  483. List<Facility.PowerUpRecipe> list = new List<Facility.PowerUpRecipe>();
  484. List<FacilityDataTable.FacilityRecipeData> list2 = new List<FacilityDataTable.FacilityRecipeData>(FacilityDataTable.m_FacilityRecipeDataArray.Values);
  485. for (int i = 0; i < list2.Count; i++)
  486. {
  487. list.Add(FacilityDataTable.GetFacilityPowerUpRecipe(list2[i].ID));
  488. }
  489. return list.ToArray();
  490. }
  491. public static bool IsExistFacilityData(int facilityTypeID, bool enableDataOnly = true)
  492. {
  493. return FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID) && (!enableDataOnly || FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData);
  494. }
  495. public static bool IsExistPowerUpMaterial(int materialID)
  496. {
  497. return FacilityDataTable.m_FacilityMaterialDataArray.ContainsKey(materialID);
  498. }
  499. public static Facility.PowerUpMaterial[] GetFacilityPowerUpMaterialArray(int materialCategoryID)
  500. {
  501. List<Facility.PowerUpMaterial> list = new List<Facility.PowerUpMaterial>();
  502. List<FacilityDataTable.FacilityMaterialData> list2 = new List<FacilityDataTable.FacilityMaterialData>(FacilityDataTable.m_FacilityMaterialDataArray.Values);
  503. for (int i = 0; i < list2.Count; i++)
  504. {
  505. if (list2[i].categoryID == materialCategoryID)
  506. {
  507. list.Add(FacilityDataTable.GetFacilityPowerUpMaterial(list2[i].ID));
  508. }
  509. }
  510. return list.ToArray();
  511. }
  512. public static int GetFacilityPowerUpMaterialCount()
  513. {
  514. return FacilityDataTable.m_FacilityMaterialDataArray.Count;
  515. }
  516. public static bool IsExistFacilityPowerUpRecipe(int facilityTypeID, bool enableDataOnly = true)
  517. {
  518. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  519. {
  520. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  521. return false;
  522. }
  523. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  524. {
  525. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  526. return false;
  527. }
  528. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  529. return facilityDefaultData.powerUpRecipeIDArray != null;
  530. }
  531. public static int[] GetFacilityPowerUpRecipeIDArray(int facilityTypeID, bool enableDataOnly = true)
  532. {
  533. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  534. {
  535. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  536. return null;
  537. }
  538. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  539. {
  540. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  541. return null;
  542. }
  543. return FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].powerUpRecipeIDArray;
  544. }
  545. public static string GetFacilityPowerUpMaterialCategoryName(int categoryID)
  546. {
  547. if (!FacilityDataTable.m_FacilityMaterialCategoryNameArray.ContainsKey(categoryID))
  548. {
  549. Debug.LogWarning(string.Format("[FacilityDataTable]素材カテゴリID「{0}」のデータは存在しない", categoryID));
  550. return null;
  551. }
  552. return FacilityDataTable.m_FacilityMaterialCategoryNameArray[categoryID];
  553. }
  554. public static int[] GetFacilityPowerUpMaterialCategoryIDArray()
  555. {
  556. List<int> list = new List<int>(FacilityDataTable.m_FacilityMaterialCategoryNameArray.Keys);
  557. return list.ToArray();
  558. }
  559. public static string GetFacilityParameterName(int parameterID)
  560. {
  561. if (!FacilityDataTable.m_FacilityParameterNameArray.ContainsKey(parameterID))
  562. {
  563. Debug.LogWarning(string.Format("[FacilityDataTable]施設パラメータID「{0}」のデータは存在しない", parameterID));
  564. return null;
  565. }
  566. return FacilityDataTable.m_FacilityParameterNameArray[parameterID];
  567. }
  568. public static bool GetFacilityCanBeUsedBusiness(int facilityID, bool enableDataOnly = true)
  569. {
  570. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  571. {
  572. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  573. return false;
  574. }
  575. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  576. {
  577. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  578. return false;
  579. }
  580. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isBusiness;
  581. }
  582. public static bool GetFacilityCanBeDestroy(int facilityID, bool enableDataOnly = true)
  583. {
  584. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  585. {
  586. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  587. return false;
  588. }
  589. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  590. {
  591. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  592. return false;
  593. }
  594. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isRemoval;
  595. }
  596. public static bool GetFacilityDefaultPlacement(int facilityID, bool enableDataOnly = true)
  597. {
  598. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  599. {
  600. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  601. return false;
  602. }
  603. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  604. {
  605. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  606. return false;
  607. }
  608. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isDefaultPlace;
  609. }
  610. public static int GetFacilityDefaultCost(int facilityID, bool enableDataOnly = true)
  611. {
  612. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityID))
  613. {
  614. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityID));
  615. return 0;
  616. }
  617. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityID].isEnableData)
  618. {
  619. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityID));
  620. return 0;
  621. }
  622. return FacilityDataTable.m_FacilityDefaultDataArray[facilityID].cost;
  623. }
  624. public static Sprite GetFacilityThumbnail(int facilityTypeID, bool enableDataOnly = true)
  625. {
  626. if (!FacilityDataTable.m_FacilityDefaultDataArray.ContainsKey(facilityTypeID))
  627. {
  628. Debug.LogWarning(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは存在しない", facilityTypeID));
  629. return null;
  630. }
  631. if (FacilityDataTable.m_FacilityThumbnailCacheDic == null)
  632. {
  633. FacilityDataTable.m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
  634. }
  635. Sprite sprite;
  636. if (FacilityDataTable.m_FacilityThumbnailCacheDic.TryGetValue(facilityTypeID, out sprite))
  637. {
  638. return sprite;
  639. }
  640. FacilityDataTable.FacilityDefaultData facilityDefaultData = FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID];
  641. if (enableDataOnly && !facilityDefaultData.isEnableData)
  642. {
  643. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  644. return null;
  645. }
  646. string text = facilityDefaultData.imageThumbnailName + ".tex";
  647. if (string.IsNullOrEmpty(text))
  648. {
  649. Debug.Log(string.Format("施設の種類ID[{0}]にはサムネイル画像情報がありません", facilityTypeID));
  650. return null;
  651. }
  652. if (!GameUty.FileSystem.IsExistentFile(text))
  653. {
  654. Debug.Log(string.Format("施設『{0}』のサムネイル画像「{1}」が見つかりませんでした", facilityDefaultData.name, text));
  655. return null;
  656. }
  657. Texture2D tex = ImportCM.CreateTexture(text);
  658. sprite = uGUIUtility.CreateSprite(tex);
  659. FacilityDataTable.m_FacilityThumbnailCacheDic.Add(facilityTypeID, sprite);
  660. return sprite;
  661. }
  662. public static Dictionary<MPN, KeyValuePair<bool, string>> GetFacilityDefaultCostume(int facilityTypeID, bool enableDataOnly = true)
  663. {
  664. if (!FacilityDataTable.m_FacilityDefaultCostumeArray.ContainsKey(facilityTypeID))
  665. {
  666. return null;
  667. }
  668. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  669. {
  670. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  671. return null;
  672. }
  673. Dictionary<MPN, KeyValuePair<bool, string>> dictionary = FacilityDataTable.m_FacilityDefaultCostumeArray[facilityTypeID];
  674. MPN[] facilityCostumeEnableMPN = FacilityDataTable.GetFacilityCostumeEnableMPN();
  675. Dictionary<MPN, KeyValuePair<bool, string>> dictionary2 = new Dictionary<MPN, KeyValuePair<bool, string>>();
  676. foreach (MPN key in facilityCostumeEnableMPN)
  677. {
  678. if (dictionary.ContainsKey(key))
  679. {
  680. dictionary2.Add(key, dictionary[key]);
  681. }
  682. }
  683. return dictionary2;
  684. }
  685. public static string GetFacilityDefaultCostumeThumbnailName(int facilityTypeID, bool enableDataOnly = true)
  686. {
  687. if (!FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray.ContainsKey(facilityTypeID))
  688. {
  689. return null;
  690. }
  691. if (enableDataOnly && !FacilityDataTable.m_FacilityDefaultDataArray[facilityTypeID].isEnableData)
  692. {
  693. Debug.Log(string.Format("[FacilityDataTable]施設の種類ID「{0}」のデータは有効ではありません", facilityTypeID));
  694. return null;
  695. }
  696. return FacilityDataTable.m_FacilityDefaultCostumeThumbnailArray[facilityTypeID];
  697. }
  698. public static MPN[] GetFacilityCostumeEnableMPN()
  699. {
  700. return FacilityDataTable.m_FacilityCostumeEnableMPN.ToArray();
  701. }
  702. public static bool IsEnableFacilityCostumeMPN(MPN mpn)
  703. {
  704. return FacilityDataTable.m_FacilityCostumeEnableMPN.Contains(mpn);
  705. }
  706. public static int[] GetFacilityBusinessTypeIDArray(bool isExclusionEmptyData = true)
  707. {
  708. List<int> list = null;
  709. if (isExclusionEmptyData)
  710. {
  711. list = new List<int>();
  712. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  713. {
  714. if (keyValuePair.Key != 9999)
  715. {
  716. list.Add(keyValuePair.Key);
  717. }
  718. }
  719. }
  720. else
  721. {
  722. list = new List<int>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Keys);
  723. }
  724. return list.ToArray();
  725. }
  726. public static FacilityDataTable.BusinessTypeData[] GetFacilityBusinessTypeDataArray(bool isExclusionEmptyData = true)
  727. {
  728. List<FacilityDataTable.BusinessTypeData> list = null;
  729. if (isExclusionEmptyData)
  730. {
  731. list = new List<FacilityDataTable.BusinessTypeData>();
  732. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  733. {
  734. if (keyValuePair.Key != 9999)
  735. {
  736. list.Add(keyValuePair.Value);
  737. }
  738. }
  739. }
  740. else
  741. {
  742. list = new List<FacilityDataTable.BusinessTypeData>(FacilityDataTable.m_FacilityBusinessTypeDataArray.Values);
  743. }
  744. return list.ToArray();
  745. }
  746. public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(int businessTypeID)
  747. {
  748. if (!FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID))
  749. {
  750. Debug.LogWarningFormat("[FacilityDataTable]事業の種類ID「{0}」に対応する情報がありません", new object[]
  751. {
  752. businessTypeID
  753. });
  754. return null;
  755. }
  756. return FacilityDataTable.m_FacilityBusinessTypeDataArray[businessTypeID];
  757. }
  758. public static bool IsExistFacilityBusinessTypeData(int businessTypeID)
  759. {
  760. return FacilityDataTable.m_FacilityBusinessTypeDataArray.ContainsKey(businessTypeID);
  761. }
  762. public static FacilityDataTable.BusinessTypeData GetFacilityBusinessTypeData(string businessName)
  763. {
  764. foreach (KeyValuePair<int, FacilityDataTable.BusinessTypeData> keyValuePair in FacilityDataTable.m_FacilityBusinessTypeDataArray)
  765. {
  766. if (!(keyValuePair.Value.name != businessName))
  767. {
  768. return keyValuePair.Value;
  769. }
  770. }
  771. Debug.LogWarningFormat("[FacilityDataTable]事業の名前「{0}」に対応する情報がありません", new object[]
  772. {
  773. businessName
  774. });
  775. return null;
  776. }
  777. private static Dictionary<int, FacilityDataTable.FacilityDefaultData> m_FacilityDefaultDataArray;
  778. private static Dictionary<int, FacilityDataTable.FacilityRecipeData> m_FacilityRecipeDataArray;
  779. private static Dictionary<int, FacilityDataTable.FacilityMaterialData> m_FacilityMaterialDataArray;
  780. private static Dictionary<int, FacilityDataTable.BusinessTypeData> m_FacilityBusinessTypeDataArray;
  781. private static Dictionary<int, string> m_FacilityMaterialCategoryNameArray;
  782. private static Dictionary<int, string> m_FacilityParameterNameArray;
  783. private static Dictionary<int, Dictionary<MPN, KeyValuePair<bool, string>>> m_FacilityDefaultCostumeArray;
  784. private static Dictionary<int, string> m_FacilityDefaultCostumeThumbnailArray;
  785. private static List<MPN> m_FacilityCostumeEnableMPN;
  786. private static Dictionary<int, Sprite> m_FacilityThumbnailCacheDic = new Dictionary<int, Sprite>();
  787. public enum BusinessType
  788. {
  789. 接待系 = 100,
  790. 営業系 = 200,
  791. アイドル系 = 300,
  792. 無し = 9999
  793. }
  794. public class FacilityDefaultData
  795. {
  796. public FacilityDefaultData(CsvParser csv, Dictionary<int, int[]> recipeIDArray, Dictionary<int, List<int>> levelTableList, HashSet<int> enableList, int y)
  797. {
  798. int num = 0;
  799. this.ID = csv.GetCellAsInteger(num++, y);
  800. int cellAsInteger = csv.GetCellAsInteger(num++, y);
  801. this.name = csv.GetCellAsString(num++, y);
  802. csv.GetCellAsString(num++, y);
  803. this.businessTypeName = csv.GetCellAsString(num++, y);
  804. this.businessTypeID = FacilityDataTable.GetFacilityBusinessTypeData(this.businessTypeName).ID;
  805. this.upwardFacilityID = csv.GetCellAsInteger(num++, y);
  806. this.fileName = csv.GetCellAsString(num++, y);
  807. this.fileNameNight = csv.GetCellAsString(num++, y);
  808. this.rank = csv.GetCellAsInteger(num++, y);
  809. string cellAsString = csv.GetCellAsString(num++, y);
  810. this.cost = csv.GetCellAsInteger(num++, y);
  811. this.income = csv.GetCellAsInteger(num++, y);
  812. this.valuation = csv.GetCellAsInteger(num++, y);
  813. this.experienceValue = csv.GetCellAsInteger(num++, y);
  814. this.isBusiness = (csv.GetCellAsString(num++, y) == "〇");
  815. this.isDefaultPlace = (csv.GetCellAsString(num++, y) == "〇");
  816. this.isRemoval = (csv.GetCellAsString(num++, y) == "〇");
  817. string cellAsString2 = csv.GetCellAsString(num++, y);
  818. this.imageThumbnailName = csv.GetCellAsString(num++, y);
  819. string cellAsString3 = csv.GetCellAsString(num++, y);
  820. this.minMaidCount = csv.GetCellAsInteger(num++, y);
  821. this.maxMaidCount = csv.GetCellAsInteger(num++, y);
  822. this.heroineMagnification = csv.GetCellAsInteger(num++, y);
  823. string cellAsString4 = csv.GetCellAsString(num++, y);
  824. this.isEnableData = enableList.Contains(this.ID);
  825. if (string.IsNullOrEmpty(cellAsString2))
  826. {
  827. this.isEnableNTR = true;
  828. this.isOnlyNTR = false;
  829. }
  830. else if (cellAsString2 == "×")
  831. {
  832. this.isEnableNTR = false;
  833. this.isOnlyNTR = false;
  834. }
  835. else if (cellAsString2 == "〇" || cellAsString2 == "○")
  836. {
  837. this.isEnableNTR = true;
  838. this.isOnlyNTR = true;
  839. }
  840. if (recipeIDArray.ContainsKey(this.ID))
  841. {
  842. this.powerUpRecipeIDArray = recipeIDArray[this.ID];
  843. }
  844. else
  845. {
  846. this.powerUpRecipeIDArray = null;
  847. }
  848. string[] array = cellAsString.Split(new char[]
  849. {
  850. ','
  851. });
  852. this.staffRankArray = new int[4];
  853. for (int i = 0; i < this.staffRankArray.Length; i++)
  854. {
  855. try
  856. {
  857. int.TryParse(array[i], out this.staffRankArray[i]);
  858. }
  859. catch (Exception ex)
  860. {
  861. this.staffRankArray[i] = 0;
  862. }
  863. }
  864. if (levelTableList.ContainsKey(this.ID))
  865. {
  866. this.levelTable = levelTableList[this.ID];
  867. }
  868. else
  869. {
  870. this.levelTable = new List<int>();
  871. this.levelTable.Add(0);
  872. this.levelTable.Add(100);
  873. this.levelTable.Add(200);
  874. this.levelTable.Add(300);
  875. this.levelTable.Add(400);
  876. }
  877. try
  878. {
  879. this.businessType = (FacilityDataTable.BusinessType)Enum.Parse(typeof(FacilityDataTable.BusinessType), this.businessTypeName);
  880. }
  881. catch (Exception e)
  882. {
  883. NDebug.AssertParseError("BusinessType", e);
  884. }
  885. if (cellAsInteger < 0)
  886. {
  887. return;
  888. }
  889. this.workData = new ScheduleCSVData.Work();
  890. this.workData.type = ScheduleTaskCtrl.TaskType.Work;
  891. this.workData.id = cellAsInteger;
  892. this.workData.name = csv.GetCellAsString(num++, y);
  893. this.workData.icon = cellAsString3;
  894. string cellAsString5 = csv.GetCellAsString(num++, y);
  895. if (!string.IsNullOrEmpty(cellAsString5) && Enum.IsDefined(typeof(ScheduleCSVData.TrainingType), cellAsString5))
  896. {
  897. this.workData.trainingType = (ScheduleCSVData.TrainingType)Enum.Parse(typeof(ScheduleCSVData.TrainingType), cellAsString5, false);
  898. }
  899. this.workData.study_rate = csv.GetCellAsInteger(num++, y);
  900. this.workData.reception = csv.GetCellAsInteger(num++, y);
  901. this.workData.care = csv.GetCellAsInteger(num++, y);
  902. this.workData.lovely = csv.GetCellAsInteger(num++, y);
  903. this.workData.elegance = csv.GetCellAsInteger(num++, y);
  904. this.workData.charm = csv.GetCellAsInteger(num++, y);
  905. this.workData.teach_rate = csv.GetCellAsInteger(num++, y);
  906. this.workData.cooking = csv.GetCellAsInteger(num++, y);
  907. this.workData.vocal = csv.GetCellAsInteger(num++, y);
  908. this.workData.dance = csv.GetCellAsInteger(num++, y);
  909. this.workData.appealPoint = csv.GetCellAsInteger(num++, y);
  910. this.workData.exp = csv.GetCellAsInteger(num++, y);
  911. this.workData.income = csv.GetCellAsInteger(num++, y);
  912. this.workData.cmdExp = csv.GetCellAsInteger(num++, y);
  913. string cellAsString6 = csv.GetCellAsString(num++, y);
  914. this.workData.condContract = new List<Contract>();
  915. string[] array2 = cellAsString6.Split(new char[]
  916. {
  917. '|'
  918. }, StringSplitOptions.RemoveEmptyEntries);
  919. for (int j = 0; j < array2.Length; j++)
  920. {
  921. if (Enum.IsDefined(typeof(Contract), array2[j]))
  922. {
  923. this.workData.condContract.Add((Contract)Enum.Parse(typeof(Contract), array2[j], false));
  924. }
  925. }
  926. string cellAsString7 = csv.GetCellAsString(num++, y);
  927. this.workData.condMaidClass = new List<int>();
  928. string[] array3 = cellAsString7.Split(new char[]
  929. {
  930. '&'
  931. }, StringSplitOptions.RemoveEmptyEntries);
  932. for (int k = 0; k < array3.Length; k++)
  933. {
  934. int id = JobClass.GetData(array3[k]).id;
  935. this.workData.condMaidClass.Add(id);
  936. }
  937. this.workData.needEventItemIdList = new List<int>();
  938. if (csv.GetCellAsString(num, 0) == "必要状態")
  939. {
  940. this.workData.needMaidStatus = csv.GetCellAsString(num++, y);
  941. string cellAsString8 = csv.GetCellAsString(num++, y);
  942. if (!string.IsNullOrEmpty(cellAsString8))
  943. {
  944. string[] array4 = cellAsString8.Split(new char[]
  945. {
  946. '|'
  947. });
  948. foreach (string s in array4)
  949. {
  950. this.workData.needEventItemIdList.Add(int.Parse(s));
  951. }
  952. }
  953. }
  954. if (num < csv.max_cell_x)
  955. {
  956. string cellAsString9 = csv.GetCellAsString(num, y);
  957. if (cellAsString9 != null)
  958. {
  959. if (!(cellAsString9 == "表示"))
  960. {
  961. if (cellAsString9 == "非表示")
  962. {
  963. this.workData.disableIfRentalMaid = true;
  964. }
  965. }
  966. else
  967. {
  968. this.workData.visibleIfRentalMaid = true;
  969. }
  970. }
  971. }
  972. num++;
  973. this.workData.condPackage = new List<string>();
  974. if (this.workData.id > 0)
  975. {
  976. this.workData.categoryID = 52;
  977. }
  978. this.workData.facility = this;
  979. }
  980. public bool isExistUpwardFacility
  981. {
  982. get
  983. {
  984. return FacilityDataTable.IsExistFacilityData(this.upwardFacilityID, true);
  985. }
  986. }
  987. public FacilityDataTable.FacilityDefaultData upwardFacility
  988. {
  989. get
  990. {
  991. if (!this.isExistUpwardFacility)
  992. {
  993. return null;
  994. }
  995. return FacilityDataTable.GetFacilityDefaultData(this.upwardFacilityID, true);
  996. }
  997. }
  998. public readonly int ID;
  999. public readonly string name;
  1000. public readonly string businessTypeName;
  1001. public readonly int businessTypeID;
  1002. public readonly FacilityDataTable.BusinessType businessType;
  1003. public readonly string fileName;
  1004. public readonly string fileNameNight;
  1005. public readonly int cost;
  1006. public readonly int income;
  1007. public readonly int valuation;
  1008. public readonly int experienceValue;
  1009. public readonly bool isBusiness;
  1010. public readonly bool isDefaultPlace;
  1011. public readonly bool isRemoval;
  1012. public readonly string imageThumbnailName;
  1013. public readonly int[] powerUpRecipeIDArray;
  1014. public readonly int minMaidCount;
  1015. public readonly int maxMaidCount;
  1016. public readonly int heroineMagnification;
  1017. public readonly int rank;
  1018. public readonly int[] staffRankArray;
  1019. public readonly List<int> levelTable;
  1020. public readonly ScheduleCSVData.Work workData;
  1021. public readonly bool isEnableNTR;
  1022. public readonly bool isOnlyNTR;
  1023. public readonly bool isEnableData;
  1024. private readonly int upwardFacilityID;
  1025. }
  1026. public class FacilityRecipeData
  1027. {
  1028. public FacilityRecipeData(CsvParser csv, int y)
  1029. {
  1030. int num = 0;
  1031. this.ID = csv.GetCellAsInteger(num++, y);
  1032. this.name = csv.GetCellAsString(num++, y);
  1033. string cellAsString = csv.GetCellAsString(num++, y);
  1034. this.conditions = new string[FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM];
  1035. for (int i = 0; i < FacilityDataTable.FacilityRecipeData.CONDITIONS_NUM; i++)
  1036. {
  1037. this.conditions[i] = csv.GetCellAsString(num++, y);
  1038. }
  1039. this.salonGrade = csv.GetCellAsInteger(num++, y);
  1040. string cellAsString2 = csv.GetCellAsString(num++, y);
  1041. if (!string.IsNullOrEmpty(cellAsString2))
  1042. {
  1043. string[] array = cellAsString2.Split(new char[]
  1044. {
  1045. ','
  1046. });
  1047. ParametersPack.StatusType key = ParametersPack.NameToStatusType(array[0]);
  1048. this.statusType = new KeyValuePair<ParametersPack.StatusType, int>(key, int.Parse(array[1]));
  1049. }
  1050. this.income = csv.GetCellAsInteger(num++, y);
  1051. this.valuation = csv.GetCellAsInteger(num++, y);
  1052. this.experienceValue = csv.GetCellAsInteger(num++, y);
  1053. if (!string.IsNullOrEmpty(cellAsString))
  1054. {
  1055. string[] array2 = cellAsString.Split(new char[]
  1056. {
  1057. ','
  1058. });
  1059. this.materialIDArray = new int[array2.Length];
  1060. for (int j = 0; j < array2.Length; j++)
  1061. {
  1062. this.materialIDArray[j] = int.Parse(array2[j]);
  1063. }
  1064. }
  1065. else
  1066. {
  1067. this.materialIDArray = null;
  1068. }
  1069. }
  1070. public bool IsSatisfyTheConditions()
  1071. {
  1072. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
  1073. bool flag = true;
  1074. flag &= (this.salonGrade <= GameMain.Instance.CharacterMgr.status.clubGrade);
  1075. if (maid != null && this.statusType.Value > 0)
  1076. {
  1077. flag &= (this.statusType.Value <= FacilityDataTable.FacilityRecipeData.GetMaidStatusValue(maid, this.statusType.Key.ToString()));
  1078. }
  1079. else
  1080. {
  1081. Debug.LogWarning("メイド0番が見つかりません");
  1082. }
  1083. return flag;
  1084. }
  1085. private static int GetMaidStatusValue(Maid maid, string name)
  1086. {
  1087. switch (name)
  1088. {
  1089. case "接待":
  1090. return maid.status.reception;
  1091. case "お世話":
  1092. return maid.status.care;
  1093. case "可憐":
  1094. return maid.status.lovely;
  1095. case "気品":
  1096. return maid.status.elegance;
  1097. case "魅惑":
  1098. return maid.status.charm;
  1099. case "料理":
  1100. return maid.status.cooking;
  1101. case "ボーカル":
  1102. return maid.status.vocal;
  1103. case "ダンス":
  1104. return maid.status.dance;
  1105. case "アピールポイント":
  1106. return maid.status.appealPoint;
  1107. case "淫欲":
  1108. return maid.status.inyoku;
  1109. case "M性":
  1110. return maid.status.mvalue;
  1111. case "変態":
  1112. return maid.status.hentai;
  1113. case "奉仕":
  1114. return maid.status.housi;
  1115. case "指導":
  1116. return maid.status.teachRate;
  1117. case "経験人数":
  1118. return maid.status.sexPlayNumberOfPeople;
  1119. case "人気ランク":
  1120. return maid.status.popularRank;
  1121. case "評価":
  1122. return maid.status.evaluation;
  1123. }
  1124. Debug.LogWarning("メイドパラメータ名" + name + "に対応する処理は未定義でした");
  1125. return 9999;
  1126. }
  1127. public static readonly int CONDITIONS_NUM = 4;
  1128. public readonly int ID;
  1129. public readonly string name;
  1130. public readonly int[] materialIDArray;
  1131. public readonly int income;
  1132. public readonly int valuation;
  1133. public readonly int experienceValue;
  1134. public readonly string[] conditions;
  1135. public readonly int salonGrade;
  1136. public readonly KeyValuePair<ParametersPack.StatusType, int> statusType;
  1137. }
  1138. public class FacilityMaterialData
  1139. {
  1140. public FacilityMaterialData(CsvParser csv, int y)
  1141. {
  1142. int num = 0;
  1143. this.ID = csv.GetCellAsInteger(num++, y);
  1144. this.name = csv.GetCellAsString(num++, y);
  1145. this.categoryID = csv.GetCellAsInteger(num++, y);
  1146. this.income = csv.GetCellAsInteger(num++, y);
  1147. this.valuation = csv.GetCellAsInteger(num++, y);
  1148. this.experienceValue = csv.GetCellAsInteger(num++, y);
  1149. }
  1150. public readonly int ID;
  1151. public readonly string name;
  1152. public readonly int categoryID;
  1153. public readonly int income;
  1154. public readonly int valuation;
  1155. public readonly int experienceValue;
  1156. }
  1157. public class BusinessTypeData
  1158. {
  1159. public BusinessTypeData(CsvParser csv, int y)
  1160. {
  1161. int num = 0;
  1162. this.ID = csv.GetCellAsInteger(num++, y);
  1163. this.name = csv.GetCellAsString(num++, y);
  1164. this.fileName = csv.GetCellAsString(num++, y);
  1165. this.description = csv.GetCellAsString(num++, y);
  1166. this.conditions = new string[FacilityDataTable.BusinessTypeData.CONDITIONS_NUM];
  1167. for (int i = 0; i < FacilityDataTable.BusinessTypeData.CONDITIONS_NUM; i++)
  1168. {
  1169. this.conditions[i] = csv.GetCellAsString(num++, y);
  1170. }
  1171. }
  1172. public static readonly int CONDITIONS_NUM = 2;
  1173. public readonly int ID;
  1174. public readonly string name;
  1175. public readonly string fileName;
  1176. public readonly string description;
  1177. public readonly string[] conditions;
  1178. }
  1179. }