PhotoScenePreset.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. public class PhotoScenePreset
  4. {
  5. public static void Create()
  6. {
  7. if (PhotoScenePreset.datas != null)
  8. {
  9. return;
  10. }
  11. PhotoScenePreset.datas = new List<PhotoScenePreset.Data>();
  12. using (AFileBase afileBase = GameUty.FileSystem.FileOpen("phot_scenepreset_list.nei"))
  13. {
  14. using (CsvParser csvParser = new CsvParser())
  15. {
  16. bool condition = csvParser.Open(afileBase);
  17. NDebug.Assert(condition, "phot_scenepreset_list.nei\nopen failed.");
  18. for (int i = 1; i < csvParser.max_cell_y; i++)
  19. {
  20. if (csvParser.IsCellToExistData(0, i))
  21. {
  22. int num = 0;
  23. PhotoScenePreset.Data data = new PhotoScenePreset.Data();
  24. data.id = csvParser.GetCellAsInteger(num++, i);
  25. data.sceneName = csvParser.GetCellAsString(num++, i);
  26. data.loadFileName = csvParser.GetCellAsString(num++, i);
  27. data.thumbnailName = csvParser.GetCellAsString(num++, i);
  28. List<string> list = new List<string>();
  29. for (;;)
  30. {
  31. string cellAsString = csvParser.GetCellAsString(num++, i);
  32. if (string.IsNullOrEmpty(cellAsString))
  33. {
  34. break;
  35. }
  36. list.Add(cellAsString);
  37. }
  38. data.charaFocusImages = list.ToArray();
  39. PhotoScenePreset.datas.Add(data);
  40. }
  41. }
  42. }
  43. }
  44. }
  45. public static List<PhotoScenePreset.Data> datas { get; private set; }
  46. public class Data
  47. {
  48. public int id;
  49. public string sceneName;
  50. public string loadFileName;
  51. public string thumbnailName;
  52. public string[] charaFocusImages;
  53. }
  54. }