using System;
using System.Collections.Generic;
using UnityEngine;

public class PhotoAlignmentPreset
{
	public static void Create()
	{
		if (PhotoAlignmentPreset.datas != null)
		{
			return;
		}
		PhotoAlignmentPreset.datas = new List<PhotoAlignmentPreset.Data>();
		using (AFileBase afileBase = GameUty.FileSystem.FileOpen("phot_alignmentpreset_list.nei"))
		{
			using (CsvParser csvParser = new CsvParser())
			{
				bool condition = csvParser.Open(afileBase);
				NDebug.Assert(condition, "phot_alignmentpreset_list.nei\nopen failed.");
				for (int i = 1; i < csvParser.max_cell_y; i++)
				{
					if (csvParser.IsCellToExistData(0, i))
					{
						int num = 0;
						PhotoAlignmentPreset.Data data = new PhotoAlignmentPreset.Data();
						data.id = csvParser.GetCellAsInteger(num++, i);
						data.thumbnailName = csvParser.GetCellAsString(num++, i);
						data.positions = new Vector3[5];
						for (int j = 0; j < data.positions.Length; j++)
						{
							data.positions[j] = csvParser.GetCellAsVector3(num++, i, ',');
						}
						PhotoAlignmentPreset.datas.Add(data);
					}
				}
			}
		}
	}

	public static PhotoAlignmentPreset.Data GetData(int id)
	{
		for (int i = 0; i < PhotoAlignmentPreset.datas.Count; i++)
		{
			if (PhotoAlignmentPreset.datas[i].id == id)
			{
				return PhotoAlignmentPreset.datas[i];
			}
		}
		return null;
	}

	public static List<PhotoAlignmentPreset.Data> datas { get; private set; }

	public class Data
	{
		public int id;

		public string thumbnailName;

		public Vector3[] positions;
	}
}
